Docker build giving error: Client.Timeout exceeded

2019-08-17 17:33发布

问题:

Creating a web project using Visual Studio 2017 with Docker support (linux) I am not able to start the example MVC project created within Visual Studio. Just yesterday everything worked fine. I checked the firewall, reinstalled Docker many times. Any ideas?

Build command (generated by visual studio):

docker build -f "C:\Users\User\source\repos\testDocker2\testDocker2\Dockerfile" -t testdocker2:dev --target base --label "com.microsoft.created-by=visual-studio" "C:\Users\User\source\repos\testDocker2"

Error: `

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

See the image below:

`

回答1:

I had the same error from the console.

After checking the "Network Connections" settings, I saw that IP was set statically, but DNS setting was empty.

So I set a DNS value also retry after that, and it worked.

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)