Docker container needs to be able to access the outside world for pulling down base images and/or any other external dependencies.
Actual behavior
Can’t access anything external.
Information
This was originally reported here. I tried changing the virtual switch from private to external but that breaks connectivity so no docker commands work.
Steps to reproduce the behavior
C:\Windows\system32>docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
docker: 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..
Sorry about the lack of response. We haven’t been able to reproduce the problem, but we haven’t forgotten you. Any additional detail you might have on your system would be great.
I saw this happening on my local machine and discovered the root cause was custom DNS servers configured on my networking device. I had Acrylic DNS enabled which has instructions on how to configure / de-configure your networking device.
Ok, after I rebuilt my machine (for other reasons), it appears to be working now. I was able to run the docker run hello-world sample and build one of my images which uses an external base. However, I should mention that I’m at home and one of your thoughts was that our (admittedly restrictive) firewall at work could’ve been to blame. I’ll give it a go when I’m in the office tomorrow and see what happens.
Hi,
I run into very similar issue. I could not docker pull/search, but DNS was working correctly. I tried reinstalling docker which did not help. During my experiments I got the feeling, that docker was insisting on using ethernet interface, which is connected nowhere (I’m using only wifi). In the end, the following procedure helped:
I uninstalled docker
I uninstalled Hyper-v
Restarted
I went to BIOS, disabled my Wifi card (also removed other connections, like company VPN)
Restarted
Installed docker, everything works correctly including pull/search
Restarted and enabled Wifi in BIOS
Things seem to still work even when I connect only thru Wifi
The important part is - It does not help to disable Wifi after the problem arises, it also does not seem to help to disable the card in BIOS after the problem arises. To me It seems that the breaking thing is that during installation of docker (and possibly hyper-v), the ethernet interface must be connected (and possibly it must be the only connected interface?). Once docker is installed, it does not care about what connection is available in the system.
I resolved the problem by adding an additional network to the docker hyper-v machine with a virutal switch type of “External” this way the hyper-v docker machine also gets an ip adres wich it can communicate with the outsite world (and therefor download images)
I have been experiencing this issue, too. I added an external network switch via the Hyper-V manager for this VM and that still did not work for me. I did some digging on the Microsoft tech site and I really don’t know how this would get outside of the host machine:
Internal virtual networks. Use this type
when you want to allow communication between virtual machines on the
same virtualization server and between virtual machines and the
management operating system. This type of virtual network is commonly
used to build a test environment in which you need to connect to the
virtual machines from the management operating system. An internal
virtual network is not bound to a physical network adapter. As a result,
an internal virtual network is isolated from all external network
traffic.
So it seems to me that internal networks don’t get outside at all. An “internal network” is the only network that the Docker VM gets assigned when it is created.
On the MobyLinux VM created in Hyper-V, I actually can see the outside world (after I configured the DockerNAT virtual switch created by the installer to actually do NAT). Running a command like docker login directly on the VM doesn’t help either.
(I had more snapshots to post, but new users are limited to one. Sorry. )
I’m on version 1.12.0-rc2-beta16 (build: 4760) 999af1e on Windows 10 build 10586 (x64).
The DockerNAT switch is named so historically. It used to provide external connectivity, but now it’s just used for host local communication and the main network connectivity for containers is done via VPNKit
I’m still having a problem, in my Network Connections window I do see that the vEthernet (DockerNAT) is listed as ‘Unidentified network’. Not sure if that is ok?
I was having this problem, and I was just poking around to see if I could fix it and the only thing I could get to work was to disable “expose container ports on localhost”. I did that and completely deleted the VM and restarted docker and now things are behaving as expected.