python - docker python 图像中的 Git 存储库

标签 python git docker

我有一个 dockerfile,我的图像是 python:3.7-alpine。

在我的项目中,我使用了一个需要下载的 git 存储库。 有什么办法吗?

我的 Dockerfile:

FROM python:3.7-alpine

ENV DOCKER_APP True

COPY requirements.txt .

RUN pip install -r requirements.txt

COPY . app/

WORKDIR app/

ENTRYPOINT ["python3", "main.py"]

我的要求:

certifi==2020.6.20
requests==2.24.0
urllib3==1.25.10
git+https://github.com/XXX/YYY

感谢

最佳答案

将以下内容添加到您的 dockerfile

RUN apk update
RUN apk add git

关于python - docker python 图像中的 Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65061121/

相关文章:

windows - Windows 上的 Git instaweb?出现错误

ruby-on-rails - 无法使用 Rails 和 Capistrano 进行部署, "HEAD is not the same as origin/master"

git - GitHub 的 TortoiseGit 问题跟踪器集成

docker - Docker Desktop 上的 Kubernetes 无法识别本地镜像

python - 覆盖 python setuptools 中的 shebang mangling

python - 使用 CSV DictReader 读取行并根据经纬度范围进行过滤

docker - 在另一台主机上的 Netflix eureka 服务发现服务器中远程 dockerised spring boot 应用程序注册

nginx - 如何从 docker 容器中获取外部主机 IP 地址

Python:subprocess.call() 的当前工作目录在内存中的目录

python - 值错误 : Field 'id' expected a number but got 'super' . [04/4/2020 18:15:11] "GET/super_user HTTP/1.1"500 132224