Docker名称解析[Errno -3]暂时失败 [英] Temporary failure in name resolution [Errno -3] with Docker
问题描述
我正在遵循 docker教程,并且在我所拥有的那一部分使用以下方法构建应用程序:
I'm following the docker tutorial and am on the part where I have to build the app using:
docker build -t friendlyhello .
它到达第4步,在暂停后出现此错误:
It reaches up to step 4, where after a pause I get this error:
Step 4/7 : RUN pip install -r requirements.txt
---> Running in 7f4635a7510a
Collecting Flask (from -r requirements.txt (line 1))
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after
connection broken by
'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection
object at 0x7fe3984d9b10>: Failed to establish a new connection:
[Errno -3] Temporary failure in name resolution',)': /simple/flask/
我不太确定此错误的含义以及如何解决该错误.
I'm not quite sure what this error means and how I can go about solving it.
感谢您的帮助!
推荐答案
我在Ubuntu 16.04和Docker 17.09.0-ce版本中遇到了同样的问题. 我认为禁用dns掩码不是正确的解决方案.
I got the same problem with Ubuntu 16.04 and Docker version 17.09.0-ce. I don't think disabling dns mask is the right solution.
这是我解决的方法:
对于Ubuntu
编辑/etc/default/docker并将您的DNS服务器添加到以下行:
Edit /etc/default/docker and add your DNS server to the following line:
示例
DOCKER_OPTS="--dns 8.8.8.8 --dns 10.252.252.252"
Example
DOCKER_OPTS="--dns 8.8.8.8 --dns 10.252.252.252"
这篇关于Docker名称解析[Errno -3]暂时失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!