【发布时间】:2017-06-09 16:12:37
【问题描述】:
我正在尝试构建一个包含 requirements.txt 文件的 docker 映像,但是在运行构建时它无法安装依赖项。
这里是 docker 文件内容: FROM 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 运行要求时,它工作正常。
我做错了吗?谁能帮帮我?
【问题讨论】:
标签: python pip dockerfile