Created
June 23, 2015 12:00
-
-
Save vpetersson/e97862472ab669d88ed9 to your computer and use it in GitHub Desktop.
Docker cleanup script.
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
#!/bin/bash | |
CONTAINERS="$(docker ps -a -q)" | |
if [ -n "$CONTAINERS" ]; then | |
docker rm "$CONTAINERS" | |
fi | |
for i in $(docker images --filter 'dangling=true' -q); do | |
docker rmi $i; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment