I'm trying to install private python-based git repos from a requirements.txt into a docker container such that they are easily editable during development.
For example, I have a Django project which contains a Dockerfile that allows building that project inside of a docker container. (It might look something like this https://github.com/JoeJasinski/docker-django-demo/blob/master/Dockerfile).
Now, say that project has a requirements.txt file that pulls in code from a private repos as follows.
django=1.11.2
-e git+git@github.com:myorg/my-private-project.git#egg=my_private_project
-e git+ssh://git@git.example.com/second-private-project@mytag#egg=second_private_project
-e git+https://github.com/myorg/third-private-project#egg=third_private_project
Ideally, I'd make it so I can edit both my main project, and the dependent repos without having to re-build the docker container each time. The Dockerfile "ADD . dest/" command makes it possible for the main project to be edited in place, but I'm having difficulty finding a good solution for installing these private repositories.
Normally (outside of Docker), the pip -e flag makes repos editable in place, which is great since I can edit and commit to them like any other repo.
However, inside of Docker, the container doesn't have access to the ssh private key needed to download the private repos (and this is probably a good thing, so we don't build the key into the docker images).
One thought I had is to download the private repos outside of the container, prior to building. Then somehow those repos would be "ADD"ed to the Docker container at build time and then individually added to the PYTHONPATH (maybe during runtime?). However, I feel like I'm over-complicating the situation.
Any suggestions as to a good, simple (Pythonic) way to install private python-based git repositories into a container so that it's easy to develop on both the main project and dependent repositories?