Last active
February 13, 2018 20:50
-
-
Save DavMorr/e460fb5644f5010a5fe2764daec4e81d to your computer and use it in GitHub Desktop.
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
Compiled from gist thread: https://gist.github.com/evanscottgray/8571828 | |
##CONTAINERS | |
stop all containers: | |
docker stop $(docker ps -a -q) | |
--prefereable | |
docker kill $(docker ps -q) | |
--brute force | |
remove all containers | |
docker rm $(docker ps -a -q) | |
##IMAGES | |
remove all docker images | |
docker rmi $(docker images -q) | |
##VOLUMES | |
remove all docker volumes | |
docker volume ls -qf dangling=true | xargs -r docker volume rm | |
##EVERYTHING UNUSED | |
docker system prune [OPTIONS] | |
--https://docs.docker.com/engine/reference/commandline/system_prune/#parent-command | |
--"This is the preferred way. Removes all non-running volumes / images / networks and everything else." | |
docker ps -q | xargs -r docker stop ; docker system purge -a | |
##ALSO SEE | |
https://github.com/ZZROTDesign/docker-clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment