1

In my local machine, I am installing an unofficial python package (not released) from a git repo using the following command

python -m pip install "mod1 @ git+https://github.com/....git"

How can I install the library inside a docker file?

Malintha
  • 4,512
  • 9
  • 48
  • 82

1 Answers1

0

If the docker container is running, and you are not running interactively inside the container, you can use the exec command:

docker exec -it <container_id_or_name> python -m pip install "mod1 @ git+https://github.com/....git"

If you are inside a container, you should be able to use the command as is, assuming you have installed python in the container (i.e. command 'python' not found).

From a dockerfile, depending on your needs, you could use the RUN command.

stomps
  • 48
  • 5