Created
April 21, 2016 19:56
-
-
Save agritsik/eb94d7bb2632e91ab7922fc591298f34 to your computer and use it in GitHub Desktop.
How to remove all docker containers and images
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
#!/usr/bin/env bash | |
# Remove all stopped containers | |
docker rm -v $(docker ps -a -q) | |
# Remove all untagged images | |
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment