tirsdag den 16. august 2016

Using ssh without polluting your know hosts file

This command will allow you to ssh into a host without adding to the known hosts file:


ssh -o "UserKnownHostsFile /dev/null" -o StrictHostKeyChecking=no -i path/to/key ubuntu@12.34.567.890

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: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: 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 

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 Docker.com get started.