Last active
May 10, 2017 13:12
-
-
Save zackferrofields/035317176eaaca32f4262a3032e8bc9c to your computer and use it in GitHub Desktop.
Docker clean up commands
This file contains hidden or 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
#!/bin/bash | |
# stop running containers | |
docker ps -q | xargs docker stop | |
# force remove all containers | |
docker ps -a -q | xargs docker rm -f | |
# force remove all untagged images | |
docker images -q --filter dangling=true | xargs docker rmi -f | |
# force remove all images | |
docker images -q | xargs docker rmi -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment