'pip install git+url within a docker environment
I am using this Docker (FROM lambci/lambda:python3.6) and I need to install a private repository package. The problem is the Docker does not have git and I can not install git using apt-get or apk install because the Docker is not Linux.
Is there any possible way to fix this installing git? Or is there any other better method I could use to install this private repository package?
Solution 1:[1]
RUN python -m pip install git+URL_OF_GIT_REPO
Solution 2:[2]
can you pip install the git repo next to your source code and mount it together with your code into the container?
cd WORKING_DIRECTORY
pip install --target ./ GIT_URL
Solution 3:[3]
in your dockerfile put this code before installing requirements and you will be fine:
RUN apt-get update && apt-get install -y git
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RDRR |
| Solution 2 | Konstantin A. Magg |
| Solution 3 | Bandar Alrooqi |
