DevOps / Scripts
bash
Intermediate
Docker Image Cleanup Script
Remove dangling images, stopped containers and unused volumes in one pass.
bash
#!/bin/bash
docker container prune -f
docker image prune -f
docker volume prune -f
echo "Space reclaimed: $(docker system df | tail -1)"
Prerequisites
- Docker >= 20
Pro Tips
- → Add --filter until=24h to keep recent images.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Intermediate
- Read time
- 2 min
- Published
- Sep 2026
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Postgres S3 Backup
Dump a Postgres database, gzip it, push to S3 with AES256 encryption.
bash
·
Intermediate
Disk Usage Alert
Send an alert when any mounted filesystem exceeds a usage threshold.
bash
·
Beginner
GitLab CI Cache Strategy
Cache node_modules and pip packages per branch in GitLab CI to cut build times.
yaml
·
Intermediate