Created
April 24, 2017 15:07
-
-
Save izonder/19dc5831bd8eb75bfa655de6d81a6e1d to your computer and use it in GitHub Desktop.
Drop obsolete and broken images and intermediate containers
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
# this will remove almost all obsolete images including broken while building images and accompanied intermediate containers | |
# remains should be removed manually (which throw exceptions "image has dependent child images") | |
docker rm `docker ps -a | grep -P '\s+[0-9a-h]{12}\s+' | awk '{print $1}'`; | |
docker rmi `docker images | grep '<none>' | awk '{print $3}'`; | |
docker volume prune; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment