|echo "Removing dangling images ..."|
|docker rmi $(docker images -f dangling=true -q)|
|echo "Removing stopped containers ..."|
|docker rm $(docker ps -qa)|
|case $1 in|
|read -p "Are you sure you want to remove all stopped containers?" -n 1 -r|
|if [[ $REPLY =~ ^[Yy]$ ]]|
|usage: docker-clean containers|images|
|containers - removes all stopped containers it can.|
|images - removes dangling (un-needed) image layers - images you no longer need|
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I ran into this issue doing what seems to be fairly lightweight stuff. In my case, even after cleaning out all containers and images, I still have about 25Gb of images according to docker (
Going to try https://docs.docker.com/articles/b2d_volume_resize/ since apparently those VMDK images are not resizable.