问题描述
在构建图像时出现以下错误
I am getting the below error while building an image
Step 1/10 : FROM ubuntu:14.04
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
推荐答案
在Win10上尝试使用Docker构建或提取映像时,我遇到了相同的问题。将Docker vEthernet(DockerNAT)
网络适配器的DNS更改为 8.8.8.8
的DNS对其进行了修复,如此。
I was facing the same issue when trying to build or pull an image with Docker on Win10. Changing the DNS of the Docker vEthernet(DockerNAT)
network adapter to 8.8.8.8
fixed it for me, as described in this GitHub issue.
要更改DNS,请转到 Docker(TrayIcon)-> 设置-> 资源-> 网络并进行设置一个固定DNS服务器 ip = 8.8.8.8
。
To change the DNS go to Docker (TrayIcon) -> Settings -> Resources -> Network and set a fixed DNS server ip = 8.8.8.8
.
将DNS服务器更改为
重启后,Docker能够再次拉出并构建映像。
After restarting Docker is able to pull and build images again.
版本信息:
Windows 10 x64 Enterprise Version 1709
$ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:05:22 2017
OS/Arch: windows/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true
这篇关于错误“获取https://registry-1.docker.io/v2/:net / http:请求已取消”在建立影像时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!