Languages

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

1 points
Asked by:
TheDalot
390

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:
TheDalot
390

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
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join