Skip to content

Instantly share code, notes, and snippets.

@izonder
Created April 24, 2017 15:07
Show Gist options
  • Save izonder/19dc5831bd8eb75bfa655de6d81a6e1d to your computer and use it in GitHub Desktop.
Save izonder/19dc5831bd8eb75bfa655de6d81a6e1d to your computer and use it in GitHub Desktop.
Drop obsolete and broken images and intermediate containers
# 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