Mercurial > hg > config
annotate bin/docker_vacuum.sh @ 897:ba2630ce851b
update default branch for git
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 01 Aug 2022 16:40:53 -0700 |
parents | 002c1e85ff30 |
children |
rev | line source |
---|---|
794 | 1 #!/bin/bash |
2 | |
3 # http://blog.yohanliyanage.com/2015/05/docker-clean-up-after-yourself/ | |
4 | |
866 | 5 # Remove all stopped containers |
6 docker container prune -f | |
7 | |
794 | 8 # Make sure exited containers are deleted |
9 docker rm -v $(docker ps -a -q -f status=exited) | |
10 | |
11 # Remove unwanted 'dangling' images | |
12 docker rmi $(docker images -f "dangling=true" -q) | |
13 | |
14 # Remove unwanted volumes | |
15 docker volume rm $(docker volume ls -qf dangling=true) | |
867 | 16 docker volume prune -f |