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

我从Docker快速入门终端开始,如下所示

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ 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拉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$ 

怎么了?


当前回答

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无线网络设置来解决,以包括以下DNS条目:8.8.8.8

欲了解更多信息,请参阅这一期(日期),它提供了这里给出的答案。

其他回答

我在VBOX 5.10中使用Docker VM在我的MAC(主机)上运行Docker时遇到了这个问题。这是一个网络问题。简单的解决方法是向VBOX映像添加一个桥接网络。您可以使用虚拟机附带的NAT配置,但需要将ssh端口从50375更改为2375。

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无线网络设置来解决,以包括以下DNS条目:8.8.8.8

欲了解更多信息,请参阅这一期(日期),它提供了这里给出的答案。

另一种情况:如果您的docker网络适配器是禁用的,它将失败与此错误。适配器被命名为“vEthernet (DockerNAT)”或类似的名称。显然,这个适配器以某种方式参与了正常的docker pull行为。让它回来解决问题。

如果你在代理之后,它是不够的,设置HTTP_PROXY和HTTPS_PROXY env。您应该在创建机器时设置它。

参数为——engine-env:

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

我有同样的问题与boot2docker和修复它重新启动它:

boot2docker restart