EN
Maven build docker image fails, [ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build
1
answers
1
points
I try to build docker image with maven, CLI:
mvn clean install
I get this error:
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build
(default) on project az-data-processor:
Could not build image: java.util.concurrent.ExecutionException:
com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException:
com.spotify.docker.client.shaded.org.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 -> [Help 1]
How can I fix it?
Thanks in advance.
1 answer
4
points
Make sure, your docker run default daemon on tcp://localhost:2375
Expose daemon on tcp://localhost:2375 without TLS
Exposing daemon on TCP without TLS helps legacy clients connect to the daemon.
It also makes yourself vulnerable to remote code execution attacks.
Use with caution.
Steps with fix:
- Go to docker settings (Second mouse click on docker icon, click settings)
- Click on checkbox 'Expose daemon on tcp://localhost:2375 without TLS'
- Apply & Restart
- Run again: mvn clean install
Solution to your problem:
After that you should see:
Result:
[INFO] Successfully built your_project_name
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
0 comments
Add comment