Skip to content

Instantly share code, notes, and snippets.

@afrikaan-official
Forked from tugberkugurlu/docker-things.sh
Last active January 30, 2017 09:51
Show Gist options
  • Save afrikaan-official/37c3d5622a738028a8c0da2414dadbea to your computer and use it in GitHub Desktop.
Save afrikaan-official/37c3d5622a738028a8c0da2414dadbea to your computer and use it in GitHub Desktop.
Docker CLI Cheatsheet
# List all stopped containers
docker ps --filter "status=exited"
# Remove all stopped containers
docker rm $(docker ps --filter "status=exited" -aq --no-trunc)
# Remove all unused images (http://stackoverflow.com/a/32723127)
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
#Remove dangling Images
docker rmi $(docker images -q -f "dangling=true")
#Remove Dangling Volumes
docker volume rm $(docker volume ls -q -f "dangling=true")
@afrikaan-official
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment