Created
March 19, 2016 09:19
-
-
Save hnakamur/b99af9e17e372aaa12c7 to your computer and use it in GitHub Desktop.
Clean docker exited processes and dangling 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
#!/bin/bash | |
eval `docker-machine env default` | |
processes=`docker ps -q -f status=exited` | |
if [ -n "$processes" ]; then | |
docker rm $processes | |
fi | |
images=`docker images -q -f dangling=true` | |
if [ -n "$images" ]; then | |
docker rmi $images | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment