Docker build在安装非IP Python包时似乎挂起

2024-04-18 14:50:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一些非pip包裹

我已经写进我的要求.txt作为:

git+https://github.com/manahl/arctic.git

这在我的本地主机上似乎可以正常工作,但当我构建docker时,我得到以下信息:

^{pr2}$

它似乎就挂了。几分钟后,它静静地向前移动,但看起来一点也不起作用。它似乎对每个基于git的依赖项都这样做。在

我做错什么了?在

Dockerfile文件:

 FROM python:3.6.1                                                                                                                                                                                                                                                                

 # Set the working directory to /app                                                                                                                                                                                                                                              
 WORKDIR /app                                                                                                                                                                                                                                                                     

 # Copy the current directory contents into the container at /app                                                                                                                                                                                                                 
 ADD . /app                                                                                                                                                                                                                                                                       

 RUN apt-get update && apt-get install -y \                                                                                                                                                                                                                                       
     git\                                                                                                                                                                                                                                                                         
     build-essential                                                                                                                                                                                                                                                              

 # Install any needed packages specified in requirements.txt                                                                                                                                                                                                                      
 RUN pip install -r scripts/requirements.txt                                                                                                                                                                                                                                      

 # Run app.py when the container launches                                                                                                                                                                                                                                         
 CMD ["python", "scheduler.py"] 

Tags: installpiptherunpyhttpsgitgithub