windows Docker 工具箱教程 Client.Timeout 在等待标头时超出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46822391/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:58:15  来源:igfitidea点击:

Docker Toolbox Tutorial Client.Timeout exceeded while awaiting headers

windowsdockerdocker-toolbox

提问by Eric

I'm following the guide at https://docs.docker.com/get-started/part2/#publish-the-image

我正在遵循https://docs.docker.com/get-started/part2/#publish-the-image 上的指南

Throughout the guide I've had trouble with this error sometimes coming up and sometimes when I rerun the commands they will work.

在整个指南中,我遇到了这个错误的麻烦,有时会出现,有时当我重新运行命令时,它们会起作用。

docker push %username%/%repository%:%tag%

I will get a response of Using default tag: latest Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

我会得到回应 Using default tag: latest Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I'm using Windows Home with Docker Toolbox.

我正在将 Windows Home 与 Docker Toolbox 一起使用。

Please let me know if any additional information is needed.

如果需要任何其他信息,请告诉我。

采纳答案by Eric

For anyone else who's looking I found the answer herewhich led me to here

对于正在寻找的其他人,我在这里找到了答案这使我来到了这里

Specifically for me these steps were helpful. In case the links break in the future.

特别是对我来说,这些步骤很有帮助。以防将来链接中断。

This worked for Windows 10 Home/Docker Toolbox

这适用于 Windows 10 Home/Docker Toolbox

  1. Right click on wifi icon on bottom right of the screen and open network and sharing center.
  2. Right click on the connection at "connections:"
  3. Click on Properties
  4. Uncheck IPv6
  5. Check IPv4
  6. Click properties
  7. Select radio button Use the following DNS addresses
  8. For preferred use 8.8.8.8
  9. Restart the computer and try again.
  1. 右击屏幕右下角的wifi图标,打开网络和共享中心。
  2. 右键单击“连接:”处的连接
  3. 点击属性
  4. 取消选中 IPv6
  5. 检查 IPv4
  6. 单击属性
  7. 选择单选按钮使用以下 DNS 地址
  8. 首选用途 8.8.8.8
  9. 重新启动计算机并重试。

回答by Serge Voloshenko

Simply go to the Docker's Settings> Networkand change DNS Server radio button to Fixed

只需转到 Docker 的Settings>Network并将 DNS 服务器单选按钮更改为Fixed

enter image description here

在此处输入图片说明

回答by Dmytro Melnychuk

Unfortunately answers above didn't help in my case, but restarting Dockerdid.

不幸的是,上面的答案对我没有帮助,但重新启动 Docker有帮助。

screen

屏幕

回答by Kostyantyn

In case someone runs his own docker repo. I had a similar "Client.Timeout exceeded while awaiting headers" when running

如果有人运行他自己的 docker repo。运行时我有一个类似的“Client.Timeout exceeded while awaiting headers”

docker login myownrepo.com:5000

It happened to be that i had port forwarding only for port 5000, and forgotten to add for port 5001. The issue was resolved by adding port 5001 (on my router) pointing to the same docker-repo-host.

碰巧我只有端口 5000 的端口转发,而忘记添加端口 5001。通过添加指向同一个 docker-repo-host 的端口 5001(在我的路由器上)解决了这个问题。

回答by MaxA

"Client.Timeout exceeded while awaiting headers"is a symptom of several possible causes. In my case it was simply a case of the private network firewallblocking the docker client machine from accessing the registry host machine.

“等待标题时超出 Client.Timeout”是多种可能原因的症状。就我而言,这只是一个私有网络防火墙阻止 docker 客户端机器访问注册表主机的情况。

To test if that's the case (for whoever may be reading this), first try temporarilydisabling the private network firewall.

要测试是否是这种情况(对于可能正在阅读本文的人),首先尝试暂时禁用专用网络防火墙。

For instance, if the private docker registry is hosted on Windows 10:

例如,如果私有 docker 注册表托管在Windows 10 上

1) open Windows Security

1)打开Windows安全

2) click on Firewall & network protection

2)点击防火墙和网络保护

3) ensure Private Network is "active" and click on it

3) 确保专用网络处于“活动状态”并单击它

4) under "Microsoft Defender Wall" switch OFF private firewall

4) 在“Microsoft Defender Wall”下关闭私有防火墙

If the IP is suddenly accessible then you need to re-enable the firewall on the host and configure it to allow access to the docker registry.

如果突然可以访问 IP,则需要重新启用主机上的防火墙并将其配置为允许访问 docker 注册表。