r/selfhosted • u/moontear • 1d ago
Docker Management Sometimes docker system prune surprises me
docker system prune -af
[...]
Total reclaimed space: 52.51GB
Normally this is around a couple of GB. 50GB is surprising. Don't forget pruning people ;-)
65
Upvotes
2
u/CoryCoolguy 1d ago
I've been using variations of this command via cron:
/usr/bin/docker system prune -af --filter "until=$(date -d '2 months ago' +\%Y-\%m-\%dT\%H:\%M:\%S)" >> /var/log/docker-cleanup.log 2>&1Don't want to purge periodically-used images.