DOCKER_HOST environment variable on windows DOCKER_HOST environment variable on windows docker docker

DOCKER_HOST environment variable on windows


On Windows 10 with Docker for Windows, the Docker Engine API is available in these two locations:

  • npipe:////./pipe/docker_engine
  • http://localhost:2375

I recommend trying with the localhost one.

Details here: https://docs.docker.com/docker-for-windows/faqs/#/how-do-i-connect-to-the-remote-docker-engine-api


It seems the user which is running Maven goals doesn't have access to docker.sock . The error message is telling which options are there to resolve the problem.

No <dockerHost> or <machine> given, no DOCKER_HOST environment variable, and no read/writable '/var/run/docker.sock'

Last option is the easiest one because it requires a file permission and it doesn't need to create any docker machine or set a DOCKER_HOST, On Linux you can change read/write permission of docker.sock with the following:

sudo chmod 776 /var/run/docker.sock

On windows go through this article : Microsoft article


After nearly a day of fruitless Googling I found this solution by myself. Trivial, but might still help others.

expose Docker daemon

You need to enable the checkbox 'Expose daemon on...' under Settings -> General