system-helpers/usr/local/bin/docker_housekeeping
Alexander Schäferdiek b2f356db0c
All checks were successful
continuous-integration/drone/push Build is passing
Add network prune to docker housekeeping
2023-04-10 19:01:52 +02:00

15 lines
No EOL
413 B
Bash
Executable file

#!/usr/bin/env bash
check_required() {
type docker &> /dev/null || { echo "Requiring 'docker' but it's not installed"; exit 1; }
type yes &> /dev/null || { echo "Requiring 'yes' but it's not installed"; exit 1; }
}
check_required
echo "Doing docker housekeeping for containers, images and volumes";
yes | docker container prune
yes | docker image prune
yes | docker volume prune
yes | docker network prune