Python 在Docker映像中克隆git存储库失败

Python 在Docker映像中克隆git存储库失败,python,git,docker,ubuntu,Python,Git,Docker,Ubuntu,我将基于ubuntu:18.04图像创建一个Docker图像 在映像中应该安装的requirements.txt文件中列出了一些python包 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 安装它们的命令是: pip install -r requiremen

我将基于ubuntu:18.04图像创建一个Docker图像

在映像中应该安装的
requirements.txt
文件中列出了一些python包

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
安装它们的命令是:

pip install -r requirements.txt
在最后一行中,当它尝试从定义的存储库获取文件时,它失败了,因为映像中没有安装密钥

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

把钥匙放在图片里是个好主意还是有更好的主意

在这里,您可以找到如何做到这一点的示例:

您基本上有两种选择:ssh密钥或。

可能的副本