Install
openclaw skills install docker-container-cleanerCLI tool to clean up stopped Docker containers, unused images, volumes, and networks to free up disk space.
openclaw skills install docker-container-cleanerA CLI tool that helps clean up Docker resources to free up disk space. It can:
The tool provides a safe, interactive mode by default, showing what will be removed and asking for confirmation before deleting anything.
Interactive cleanup (recommended for first use):
python3 scripts/main.py clean
Remove stopped containers only:
python3 scripts/main.py clean --containers
Remove dangling images only:
python3 scripts/main.py clean --images --dangling
Remove unused images (all images not used by containers):
python3 scripts/main.py clean --images --unused
Remove unused volumes:
python3 scripts/main.py clean --volumes
Remove unused networks:
python3 scripts/main.py clean --networks
Force cleanup (no confirmation):
python3 scripts/main.py clean --all --force
Dry run (show what would be removed):
python3 scripts/main.py clean --all --dry-run
python3 scripts/main.py clean
Output:
Docker Cleanup Tool
===================
Found resources:
- Stopped containers: 3 (using 1.2GB)
- Dangling images: 5 (using 850MB)
- Unused images: 2 (using 450MB)
- Unused volumes: 1 (using 100MB)
- Unused networks: 0
Total disk space that can be freed: 2.6GB
What would you like to clean up?
1. Remove stopped containers
2. Remove dangling images
3. Remove unused images
4. Remove unused volumes
5. Remove unused networks
6. All of the above
7. Cancel
Enter choice [1-7]: 2
About to remove 5 dangling images (850MB):
- python:3.9-alpine (dangling)
- node:16-slim (dangling)
- ...
Are you sure? (y/N): y
Removing images...
✅ Cleanup complete! Freed 850MB of disk space.
python3 scripts/main.py status --format json
Output:
{
"containers": {
"running": 2,
"stopped": 3,
"stopped_size_mb": 1200
},
"images": {
"total": 15,
"dangling": 5,
"dangling_size_mb": 850,
"unused": 2,
"unused_size_mb": 450
},
"volumes": {
"total": 4,
"unused": 1,
"unused_size_mb": 100
},
"networks": {
"total": 3,
"unused": 0
},
"total_reclaimable_mb": 2600
}
docker command)Install Docker SDK for Python (optional):
pip install docker
docker builder prune)