Search code examples
visual-studiodockervisual-studio-2017.net-core

The DOCKER_REGISTRY variable is not set. Defaulting to a blank string


I have created a new DotNetCore 2.0 web project in VisualStudio 2017. I have docker running in machine with Docker Server Host configured for Windows.

While running solution i'm getting below error,

'The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.'

Building myfirstdotnetcore Service 'myfirstdotnetcore' failed to build:

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


Solution

  • I had this issue and has resolved after taken below steps.

    Run Visual Studio as Administrator

    Your running Docker host should logged-in to your DockerHub account.

    This is very important The main reason for this issue is Visual Studio couldn't download nano server image from docker hub. So always make sure that you logged in to your dockerhub account from running host