【发布时间】:2017-04-05 22:18:04
【问题描述】:
问题
在构建映像期间我无法安装任何软件包。从 docker hub 拉取是可以的,但是当 docker 尝试使用网络构建图像时出现问题。例如,如果我尝试运行:
$ docker build -t sample-image:latest .
... 上面命令使用的 Dockerfile 有以下行:
RUN pip install -r requirements.txt
...然后我得到下一个错误:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fdbe102e278>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/sanic/
Could not find a version that satisfies the requirement sanic (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for sanic (from -r requirements.txt (line 1))
...更新ubuntu包时出现同样的错误
信息
docker 和 docker compose 由官方 docker 文档安装(没有任何更改)。
Server Version: 17.03.1-ce
Storage Driver: aufs
Kernel Version: 4.8.0-45-generic
Operating System: Ubuntu 16.04.2 LTS
Architecture: x86_64
CPUs: 2
Total Memory: 3.763 GiB
requirements.txt:
sanic
asyncpg
asyncio
uvloop
Dockerfile:
FROM python:3.5-onbuild
WORKDIR /usr/src/app
# https://github.com/vishnubob/wait-for-it
CMD ["./run/wait-for-it.sh", "db:5432", "--", "python", "index.py"]
附言
我测试了更多的决定,但还没有任何帮助。谢谢大家的帮助:)
【问题讨论】:
标签: linux networking docker ubuntu-16.04