Languages

Maven build docker image fails, [ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build

1 points
Asked by:
Kate_C
19580

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
Answered by:
Kate_C
19580

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:

  1. Go to docker settings (Second mouse click on docker icon, click settings)
  2. Click on checkbox 'Expose daemon on tcp://localhost:2375 without TLS'
  3. Apply & Restart
  4. 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
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join