networking超时尝试连接到https://index.docker.io

我刚刚在他们的网页上安装了Docker-Toolbox

我从Docker QuickStart Terminal开始,看看如下

  ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ docker is configured to use the default machine with IP 192.168.99.100 For help getting started, check out the docs at https://docs.docker.com bash-3.2$ 

但是当我试图执行docker pull hello-world ,这是我所看到的

 bash-3.2$ docker run hello-world Unable to find image 'hello-world:latest' locally Pulling repository docker.io/library/hello-world Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/hello-world/images. You may want to check your internet connection or if you are behind a proxy. bash-3.2$ 

怎么了?

今天早上我有同样的问题,下面给我解决了这个问题:

 $ docker-machine restart default # Restart the environment $ eval $(docker-machine env default) # Refresh your environment settings 

看起来,这是由于Docker虚拟机进入一个奇怪的状态。 这里有一个开放的github问题

我在Windows 10上安装了没有工具箱的Docker,所以需要启用Hyper-V的版本。

对于Docker版本1.12,我必须进入任务栏,右键单击泊坞窗图标,select设置 – >networking,并将DNS服务器设置为固定的,以便使用Google的DNS服务器8.8.8.8

一旦这个设置被改变,它终于奏效了。

更简单的解决scheme是在/ etc / default / docker文件中添加以下条目

export http_proxy =“http:// HOST:PORT /”

并重新启动泊坞窗服务

服务docker重启

2016年8月更新

使用Docker for Mac(版本1.12.0),看到这样的问题:

 ➜ docker pull node Using default tag: latest Pulling repository docker.io/library/node Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/node/images. You may want to check your internet connection or if you are behind a proxy.`enter code here` 

这是通过更新我的MacBook Pro无线networking设置,以包括以下DNS条目解决: 8.8.8.8

有关更多信息,请参阅此处(注明date)的问题 ,其中提供了此处给出的答案。

我遇到了这个问题在VBOX 5.10中使用Docker VM在我的MAC(主机)上运行Docker。 这是一个networking问题。 简单的解决方法是将桥接networking添加到VBOX图像。 您可以使用随VM一起提供的NATconfiguration,但需要将ssh端口从50375更改为2375。

 sudo service docker stop sudo service docker start 

为我工作..

不知何故, sudo service docker restart没有工作

(RHEL7)

我昨天碰到了这个完全相同的问题,没有一个“stream行”的答案(如修复DNS到8.8.8.8)为我工作。 我最终发生在这个链接,并做了伎俩… https://github.com/docker/for-win/issues/16

在Docker for Windows,Windows 10和Hyper-V之间,虚拟networking适配器创build过程中似乎存在问题。 具体来说,最终可能会有两个“vEthernet(DockerNAT)”networking适配器。 使用Get-NetAdapter "vEthernet (DockerNAT)" (在提升的PowerShell控制台中)检查此项。 如果结果显示多个适配器,则可以禁用并将其重命名为:

 $vmNetAdapter = Get-VMNetworkAdapter -ManagementOS -SwitchName DockerNAT Get-NetAdapter "vEthernet (DockerNAT)" | ? { $_.DeviceID -ne $vmNetAdapter.DeviceID } | Disable-NetAdapter -Confirm:$False -PassThru | Rename-NetAdapter -NewName "OLD" 

然后打开设备pipe理器并删除禁用的适配器(出于某种原因,您可以从此处执行此操作,但不能从networking和共享中心适配器视图执行此操作)。

我假设你有一个networking问题。 你是在代理的背后? 是否有可能过滤连接到docker.io或阻止docker.io用户代理?

我安装了工具箱并运行testing。 它工作正常,在这里:

 docker is configured to use the default machine with IP 192.168.99.101 For help getting started, check out the docs at https://docs.docker.com bash-3.2$ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 535020c3e8ad: Pull complete af340544ed62: Already exists library/hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:d5fbd996e6562438f7ea5389d7da867fe58e04d581810e230df4cc073271ea52 Status: Downloaded newer image for hello-world:latest Hello from Docker. This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker Hub account: https://hub.docker.com For more examples and ideas, visit: https://docs.docker.com/userguide/ bash-3.2$ 

在Windows 10上。只需右键单击系统托盘图标 – >设置… – >rest – > Restrart Docker

在Windows 7上,如果你相信你是在代理后面

  1. login到默认机器

     $ docker-machine ssh default 
  2. 更新configuration文件以更新代理设置

     docker@default:~$ sudo vi /var/lib/boot2docker/profile 
  3. 根据需要从下面追加

     # replace with your office's proxy environment export"HTTP_PROXY=http://PROXY:PORT" export"HTTPS_PROXY=http://PROXY:PORT" # you can add more no_proxy with your environment. export"NO_PROXY=192.168.99.*,*.local,169.254/16,*.example.com,192.168.59.*" 
  4. 出口

     docker@default:~$ exit 
  5. 重新启动docker机器

     docker-machine restart default 
  6. 更新环境设置

     eval $(docker-machine env default) 

上面的步骤略微调整,但在故障排除指南中给出: https : //docs.docker.com/toolbox/faqs/troubleshoot/#/update-varlibboot2dockerprofile-on-the-docker-machine

我有boot2docker相同的问题,并通过重新启动它来解决它:

 boot2docker restart 

我今天刚刚遇到了1.10.1 ,现有的解决scheme都没有工作。 我试图重新启动,升级,重新生成证书,…

我注意到我在机器上创build了很多networking。 删除它们后:

 docker network ls | grep bridge | awk '{print $1}' | xargs -n1 docker network rm 

DNS再次开始工作。

注意:您可以忽略有关预定义networking的错误

如果您在代理之后,则仅设置HTTP_PROXYHTTPS_PROXY env是不够的。 机器创build时应该设置它。

这个--engine-env--engine-env

 docker-machine create -d "virtualbox" --engine-env HTTP_PROXY=http://<PROXY>:<PORT> --engine-env HTTPS_PROXY=<PROXY>:<PORT> dev 

在我的情况下,在Alpine Linux上安装docker我得到的错误:

networking超时尝试连接到https://index.docker.io/v1/repositories/library/ ……..

使用这里的脚本: https : //github.com/docker/docker/blob/master/contrib/download-frozen-image-v2.sh

作品。 它使用curl下载图像,然后告诉你如何解开和“docker加载”它。

我尝试了8.8.8.8的静态DNS的上述方法和禁用ipv6(我不明白代理东西),他们都没有为我工作。

编辑9/8/2016:

我最初使用dropbear而不是openssh。 用openssh重新安装Alpine修复了这个问题。

下一个问题是在拉取期间“ApplyLayer退出状态1 stdout:stderr:chmod / bin / mount:权限被拒绝”错误。

来自(nixaid.com/grsec-in-docker/):

为了构buildDocker镜像,我必须禁用以下grsec保护。 修改/etc/sysctl.d/grsec.conf,如下所示:

kernel.grsecurity.chroot_deny_chmod = 0 kernel.grsecurity.chroot_deny_mknod = 0 kernel.grsecurity.chroot_caps = 0#与systemd软件包/ CAP_SETFCAP相关

在高山的情况下,虽然它

/etc/sysctl.d/00-alpine.conf

重启

重新启动Docker或重新创build映像没有帮助。 我重新启动Windows无济于事。

令人震惊的是,当我进入运行的容器ssh'ed并做了curl https://index.docker.io/v1/repositories/library/hello-world/images我得到了一个完全有效的回应。

我在64位Windows 10 Pro上使用了带有VirtualBox的Docker工具箱 。

在我的情况下,解决scheme是卸载旧的Docker版本,并安装使用Hyper-V而不是VirtualBox 的新版本。

现在Docker再次工作。

如果你在代理后面请使用下面的命令

 sudo mkdir /etc/systemd/system/docker.service.d sudo cd /etc/systemd/system/docker.service.d sudo vi http-proxy.conf 
 [Service] Environment=HTTP_PROXY=http://proxy-server-ip:port" "NO_PROXY=localhost,127.0.0.1" sudo systemctl daemon-reload sudo systemctl show --property=Environment docker sudo systemctl restart docker 

试试这个,如果你可以获取最新的Ubuntu的

 sudo docker run -it ubuntu bash 

无法find图像ubuntu:latest本地ubuntu:latest

最新:从库/ ubuntu b3e1c725a85f拉:拉完成

4daad8bdde31:拉完成

63fe8c0068a8:拉完成

4a70713c436f:拉完成

bd842a2105a8:拉完成

消化:

SHA256:7a64bc9c8843b0a8c8b8a7e4715b7615e4e1b0d8ca3c7e7a76ec8250899c397a

状态:下载更新的图像为Ubuntu:最新

它终于为我工作:)

另一个场景:如果您的dockernetworking适配器被禁用,它将会失败并出现这个错误。 该适配器被命名为“vEthernet(DockerNAT)”或类似的。 很明显,这个适配器涉及到正常的泊坞窗拉动行为。 启用它来解决问题。

在Windows上,当我从工作networking移动到家庭networking时发生这种情况。

要解决它,运行:

  1. docker-machine stop
  2. docker-machine start
  3. docker-env
  4. "C:\Program Files\Docker Toolbox\docker-machine.exe" env | Invoke-Expression