Created
December 29, 2017 22:55
-
-
Save farrellit/3b4d43933c86620a74ad1f30636d540e to your computer and use it in GitHub Desktop.
docker cleanup
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
# remove containers which have exited | |
docker ps -a | awk '/Exited[ ]\(/ {print $1}' | xargs docker rm | |
# remove images without tag nor repo | |
docker images | awk '/^<none>[[:space:]]*<none>/ {print $3}' | xargs docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment