我正在尝试构建一个包含requirements.txt文件的docker镜像,但是在运行构建时它无法安装依赖项。
这里是docker文件内容: 来自tiangolo / uwsgi-nginx-flask:flask
> # copy over our requirements.txt file COPY requirements.txt /tmp/
>
> # upgrade pip and install required python packages RUN apt-get update pip install -U pip RUN apt-get update pip install -r
> /tmp/requirements.txt
>
> # copy over our app code COPY ./app /app
requirements.txt:
Flask==0.12.2
pyfiglet==0.7.5
这是即将出现的错误:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb04e93a950>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pip/
但是当我将要求作为pip install requirements.txt
运行时,它的工作正常。
我做错了吗?有人可以帮帮我吗?
答案 0 :(得分:0)
我的防火墙阻止了连接。它现在工作正常。