tom
tom

Reputation: 1493

Docker error on Windows 2016 "Client.Timeout exceeded while awaiting headers"

I get the following error when I try to do "docker run" on my Windows 2016.

PS C:\Users\Administrator> docker run microsoft/sample-dotnet
Unable to find image 'microsoft/sample-dotnet:latest' locally
C:\Program Files\Docker\docker.exe: 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).
See 'C:\Program Files\Docker\docker.exe run --help'.

I followed the instructions here to get started.

This is different from this question because this is Windows.

Any ideas?

Upvotes: 5

Views: 7915

Answers (6)

GoodFellasNever
GoodFellasNever

Reputation: 41

So I faced the same problem and it took me days to figure out what to do. Summary:

  1. I disabled Hyper-V (from the Hyper-V Manager, that comes with docker-desktop)
  2. I disabled every Network Adapter that is a part of Hyper-V (vEthernet(DockerNAT), vEthernet(Default Switch) and Virtual-Box-Host-Only Network)
  3. In the Docker Settings, I set the DNS to 8.8.8.8
  4. In the Docker Settings, I set Proxy to no-Proxy
  5. In the General Docker Settings, I checked "Expose Daemon on tcp[..]"
  6. I reactivated the following network adapters: vEthernet(DockerNAT), vEthernet(Default Switch) and Virtual-Box-Host-Only Network
  7. I restarted (enabled) Hyper-V
  8. I restarted Docker
  9. In my console I tried docker run hello-world
  10. Pull works! Login works! Everything works! -> Time to get a coffee

Upvotes: 0

Moses Nero
Moses Nero

Reputation: 11

Kindly launch the docker setting and set your dns to 8.8.8.8

Upvotes: 0

Kairat Koibagarov
Kairat Koibagarov

Reputation: 1475

Ubuntu, Centos

Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that 
mkdir -p /etc/systemd/system/docker.service.d
sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
adds the HTTP_PROXY environment variable:

[Service]
Environment="HTTP_PROXY=http://172.28.5.202:3128/"

Or, if you are behind an HTTPS proxy server, create a file called

/etc/systemd/system/docker.service.d/https-proxy.conf that adds the HTTPS_PROXY environment variable:
[Service]
Environment="HTTPS_PROXY=http://172.28.5.202:3128/"

Flush changes:

$ sudo systemctl daemon-reload
Restart Docker:
$ sudo systemctl restart docker

It worked!

Upvotes: -1

Sai Bhasker Raju
Sai Bhasker Raju

Reputation: 531

Go to Docker settings > network > DNS server . change from automatic to fixed ( default is 8.8.8.8 ) . worked on win 10

Upvotes: 3

Hem Kant
Hem Kant

Reputation: 197

same Problem for Windows. Some people wrote to delete dns 8.8.8.8 from resolve.conf But i added this dns to my Settings (right click on docker icon -> Network -> Set DNS to Fixed (8.8.8.8)

Upvotes: 7

tom
tom

Reputation: 1493

It turns out I needed to set the proxy as per this link.

Here is an example of what I had to do (replacing my proxy address):

[Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://myproxy:80/", [EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("HTTPS_PROXY", "https://myproxy:80/", [EnvironmentVariableTarget]::Machine)
restart-service docker

Upvotes: 2

Related Questions