A safety-first Bash wrapper around docker system df and docker system prune that defaults to SAFE_MODE=true and asks for confirmation before removal.
- Shows current Docker disk usage first
- Defaults to non-destructive safe mode
- Interactive confirmation before prune when safe mode is off
docker_cleanup.sh— Main cleanup script
- Bash
- Docker CLI and daemon access
git clone https://github.com/biprajit007/docker-cleanup-script-safe-mode.git
cd docker-cleanup-script-safe-mode
chmod +x docker_cleanup.sh./docker_cleanup.shSAFE_MODE=false ./docker_cleanup.sh- SAFE_MODE is intentionally true by default.
- docker system prune -a --volumes can delete stopped containers, unused images, networks, and volumes. Review the prompt carefully.
- No per-resource filtering or dry-run diff beyond docker system df
- Interactive prompt makes unattended automation awkward