【问题标题】:unable to run requirements.txt file while building docker image构建 docker 映像时无法运行 requirements.txt 文件
【发布时间】: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


    【解决方案1】:

    我的防火墙阻止了连接。现在可以正常使用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-24
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-02
      • 1970-01-01
      • 2019-04-09
      相关资源
      最近更新 更多