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

I found these related issues on github:

  • https://github.com/Microsoft/DockerTools/issues/130 (this is tracking the fix)
  • https://github.com/aspnet/Docs/issues/7234

TLDR; This error is misleading, and can mask several internal docker errors which Visual Studio currently swallows (these should be visible in your build output) - this is expected to be fixed in Visual Studio 2017 15.8 but as of 15.8.2 this is still a problem and the bug is still open, so I assume its still on the way.

Until then, the general consensus seems to be that the following step combination should workaround most of the underlying issues. NB! these might need to be repeated after machine restarts.

  • Run Visual Studio as Administrator
  • Ensure you are logged in to Docker - e.g. run docker login
  • Restart Docker for windows (right click in system tray and select restart)

I'm not certain if the order of the above might be important.


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


I needed to set docker registry Environment Variable. Path needs to be lowercase for some reason.

[Environment]::SetEnvironmentVariable("DOCKER_REGISTRY", "d:\docker\registry\", "Machine")