Network timed out while trying to connect to https

2019-03-07 09:29发布

I installed Docker-Toolbox just now while following their webpage

I started with Docker QuickStart Terminal and see following

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

But when I try to perform docker pull hello-world, this is what I see

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$ 

What's wrong?

19条回答
Juvenile、少年°
2楼-- · 2019-03-07 10:18

Another scenario: if your docker network adapter is disabled, it will fail with this error. The adapter is named "vEthernet (DockerNAT)" or similar. Apparently this adapter is involved somehow in the normal docker pull behavior. Enable it back to solve the problem.

查看更多
冷血范
3楼-- · 2019-03-07 10:20

I ran into this problem running Docker on my MAC(host) with Docker VM in VBOX 5.10. It is a networking issue. The simple fix is to add a bridged network to the VBOX image. You can use the included NAT config present with the VM, but you need to change the ssh port from 50375 to 2375.

查看更多
Deceive 欺骗
4楼-- · 2019-03-07 10:21

Update August 2016

Using Docker for Mac (version 1.12.0), was seeing issues of the form:

➜  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`

This was resolved by updating my MacBook Pro wireless network settings to include the following DNS entry: 8.8.8.8

For further info, please see this (dated) issue which provided the answer given here.

查看更多
你好瞎i
5楼-- · 2019-03-07 10:23

On Windows 10. Just right-click on the systray docker icon-> Settings... -> Rest -> Restrart Docker

查看更多
ら.Afraid
6楼-- · 2019-03-07 10:24

I installed Docker without the Toolbox on Windows 10, so the version that requires Hyper-V to be enabled.

For Docker version 1.12 I had to go into the taskbar, right click the Docker Icon, select Settings -> Network and set the DNS Server to fixed, so that is uses Google's DNS server at 8.8.8.8.

Once that setting was changed, it finally worked.

查看更多
Lonely孤独者°
7楼-- · 2019-03-07 10:27

Restarting Docker or recreating the image did not help. I rebooted Windows to no avail.

Astoundingly, when I ssh'ed into the running container and did curl https://index.docker.io/v1/repositories/library/hello-world/images I got a perfectly valid response.

I used the Docker Toolbox with VirtualBox on 64bit Windows 10 Pro.

The solution in my case was to uninstall the old Docker version and install the new one that uses Hyper-V instead of VirtualBox.

Now Docker works again.

查看更多
登录 后发表回答