Last active
February 4, 2020 10:33
-
-
Save RafalWilinski/61ddb446daf2aa655c83d0d91efba858 to your computer and use it in GitHub Desktop.
Docker Useful commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete all images | |
docker images | tr -s ' ' | cut -d ' ' -f3 | xargs docker rmi -f | |
# To delete not running images and ghost ones: | |
docker rm `docker ps --no-trunc -aq` | |
# Delete kill all containers | |
docker ps | tr -s ' ' | cut -d ' ' f2 | xargs docker kill | |
# Delete all volumes | |
docker volume ls | tr -s ' ' | cut -d ' ' -f2 | xargs docker volume rm | |
# If first one fails, use this one: | |
docker volume rm $(docker volume ls -qf dangling=true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment