Mercurial > hg > config
annotate bin/docker_vacuum.sh @ 896:83618049c2ff
py3
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 11 Feb 2022 09:33:38 -0800 |
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 |