mandag den 8. august 2016

How to solve Docker maven plugin failure to connect

The following error indicates that your default docker machine, does not exists, has been improperly configured, or is not connected to your shell.

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.3:build (default-cli) on project foobar: Exception caught: java.util.concurrent.ExecutionException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/, localhost/0:0:0:0:0:0:0:1] failed: Connection refused 

The solution depends on which of the three reasons is the case. I usually try this:

eval "$(docker-machine env default)"

If this does not work I would delete the default machine and recreate it:
  1. Delete the default machine.
    docker-machine rm default
  2. Recreate the default machine.
    docker-machine create --driver virtualbox default
  3. Reconnect the shell to the default machine.
    eval "$(docker-machine env default)"

For more information see get started.

Ingen kommentarer:

Send en kommentar

Bemærk! Kun medlemmer af denne blog kan sende kommentarer.