Mercurial > hg > config
annotate bin/docker_vacuum.sh @ 922:74dc16f074be default tip
ignore ff merges
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 03 Oct 2024 05:36:19 -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 |