0

I'm going to create a Docker image based on ubuntu:18.04 image.

There are some python packages listed in a requirements.txt file which should be installed in the image.

reportlab==2.7
newrelic==2.98.0.81
pympler==0.4.3
unidecode
python-dateutil
git+ssh://git@bitbucket.org/myproject/myprojects-tools.git@master

The command to install them is:

pip install -r requirements.txt

In the last line when it tries to fetch files from the defined repository, it failes, because the key is not installed in the image.

Is it good idea to put the key inside the image or there are better ideas?

Super Hornet
  • 2,839
  • 5
  • 27
  • 55
  • 2
    Possible duplicate of [Clone private git repo with dockerfile](https://stackoverflow.com/questions/23391839/clone-private-git-repo-with-dockerfile) – David Maze Sep 21 '18 at 15:23

1 Answers1

1

Here you can find examples on how to do this: https://github.com/bmihelac/docker-images-with-private-python-packages-example

You basically have two alternatives: ssh keys or deploy/access tokens.

Alessandro Cosentino
  • 2,268
  • 1
  • 21
  • 30