Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOCKER_HOST environment variable on windows

I'm running Docker 1.12.0 on a Windows 10 machine. I'm developing a Java program, using Maven 3.3.9 as a dependency manager. I have a maven docker plugin (https://github.com/fabric8io/docker-maven-plugin), which gives the following error on clean install.

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Execution docker-build-start of goal io.fabric8:docker-maven-plugin:0.15.16:build failed: No <dockerHost> or <machine> given, no DOCKER_HOST environment variable, and no read/writable '/var/run/docker.sock' -> [Help 1]

When I run a clean install with the following configuration option in the POM file:

<dockerHost>tcp://0.0.0.0:2376</dockerHost>

the following result is shown.

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Cannot create docker access object: Cannot extract API version from server https://0.0.0.0:2376: Connect to 0.0.0.0:2376 [/0.0.0.0] failed: Connection refused: connect -> [Help 1]

My question: is there an IP address I can use to tell this maven plugin where it can reach the daemon? Normal docker commands work perfectly fine. The plugin works without any problems on OS X.

like image 525
user2969329 Avatar asked Sep 14 '16 09:09

user2969329


People also ask

Where are Docker container environment variables stored?

It's not stored (in a file) anywhere. It's passed from Docker to the process running in the container.

What is Docker_host?

DOCKER_HOST. Sets the URL of the Docker daemon. Defaults to: unix:///var/run/docker.sock (same as with the Docker client).


1 Answers

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

like image 134
friism Avatar answered Sep 18 '22 05:09

friism