I am trying to directly build a docker image with maven with mvn package docker:build
.
Docker is running and docker ps
shows me my containers, so I assume that everything is running correctly. I do get the following error though:
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (default-cli) on project reservierung: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: o rg.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect ->
My first approach was that since I am working on windows I need to call the docker-machine ip address instead of localhost, but that also didn't work. I am kind of at a loss here, because I assume that it's something simple that I am doing wrong, but I cannot find anything about the connection refused error when docker is (seemingly) running properly.
I am sorry if this is trivial.
I fixed this by updating
docker-maven-plugin
version to1.4.13
.i solve the problem using this setting:
On windows 7 64 the docker env seems a bit tricky to install as it requires a linuxVM to run (update issues with previous vbox installation) https://github.com/docker/machine/issues/3396 )
Luckily in the docker quickstart terminal we can do:
showing us what to put into the plugin configuration
but only after using the advice found here:
Docker: An error occurred trying to connect
with the important part being:
we can run the
mvnw docker:build
successfully in the cmd/intellij terminal :)Below change fixed my issue on OSX El Capitan, Docker Version 1.12.1 (build: 12133):
Please restart docker if
mvn package docker:build
still fails.