Skip to content

Instantly share code, notes, and snippets.

@spboyer
Last active December 17, 2015 14:26
Show Gist options
  • Select an option

  • Save spboyer/96174aea4a050a2b4528 to your computer and use it in GitHub Desktop.

Select an option

Save spboyer/96174aea4a050a2b4528 to your computer and use it in GitHub Desktop.
Docker Scripts
#remove all stopped containers
docker rm $(docker ps -a -q)
#remove all untagged images
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
#Kill all running containers
docker kill $(docker ps -q)
#Delete all stopped containers (including data-only containers)
docker rm $(docker ps -a -q)
#Delete all 'untagged/dangling' (<none>) images
docker rmi $(docker images -q -f dangling=true)
#Delete ALL images
docker rmi $(docker images -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment