Skip to content

Instantly share code, notes, and snippets.

@sshadmand
Last active May 14, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshadmand/a56630016d42f6b5a63bda09d9598308 to your computer and use it in GitHub Desktop.
Save sshadmand/a56630016d42f6b5a63bda09d9598308 to your computer and use it in GitHub Desktop.
Docker Shortcuts
# This works becuase tagless images look like this:
#
# REPOSITORY TAG IMAGE ID CREATED SIZE
# <none> <none> 39c3774dd2fb 10 minutes ago 417 MB
docker rmi $(docker images -a | grep none)
# Get hash of first column and reverse grep containers called "fake"
docker rm $(docker ps -a | grep -v fake | awk '{print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment