Skip to content

Instantly share code, notes, and snippets.

@jmeyo
Last active August 29, 2015 13:57
Show Gist options
  • Save jmeyo/9483785 to your computer and use it in GitHub Desktop.
Save jmeyo/9483785 to your computer and use it in GitHub Desktop.
Docker commands stylesheet

remove docker instances which have exited

sudo docker ps -a -notrunc | grep 'Exit' | awk '{print $1}' | xargs -r sudo docker rm

Get Ip of all running instances

paste <(sudo docker ps | tail -n +2 | awk {'printf "%s\t%s\n", $1, $2 '}) <(sudo docker ps  -q | xargs sudo docker inspect | tail -n +2 | grep IPAddress | awk '{ print $2 }' | tr -d ',"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment