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.
On Windows with Docker/Hyper-V this occurred to me with com.spotify:docker-maven-plugin:1.0.0. There is a discussion about this on another forum, where they advise to turn on
in docker Settings/General Tab. It worked for me.
i solve the problem using this setting:
<configuration>
<imageName>10.10.8.175:5000/${artifactId}:${project.version}</imageName>
<dockerHost>https://192.168.99.100:2376</dockerHost>
<dockerCertPath>C:\Users\AtomView\.docker\machine\machines\default</dockerCertPath>
<dockerDirectory>src/main/resources/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>*.zip</include>
</resource>
</resources>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With