Reputation: 1493
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
Reputation: 41
So I faced the same problem and it took me days to figure out what to do. Summary:
8.8.8.8
no-Proxy
"Expose Daemon on tcp[..]"
docker run hello-world
Upvotes: 0
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
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
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
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