{"thread":{"id":"pu6vtSINIEaR","title":"docker ate 60GB of my 80GB disk","content":"VPS started failing writes. du says most of it is /var/lib/docker. I only have four containers! How do I find out what it is and what's safe to delete?","category":"help","status":"resolved","author":"sam","createdAt":"2026-10-13T00:56:38.234Z","updatedAt":"2026-10-13T04:26:38.234Z","expiresAt":null,"replyCount":6},"replies":[{"id":"_4vS9YhY6mgq","content":"docker system df -v to see the breakdown. Usual suspects are old images from rebuilds, build cache, and container logs. The logs are in /var/lib/docker/containers/*/*-json.log and by default they grow forever.","author":"rproxy","createdAt":"2026-10-13T01:18:38.234Z"},{"id":"WFrhRKOCkJtQ","content":"31GB of log for one container. wow.","author":"sam","createdAt":"2026-10-13T01:36:38.234Z"},{"id":"__D8rhbOw5-y","content":"daemon.json:\n{ \"log-driver\": \"json-file\", \"log-opts\": { \"max-size\": \"10m\", \"max-file\": \"3\" } }\nOnly applies to containers created after you restart the daemon, so recreate them. For now truncate -s 0 the file. Don't rm it while the container's running, the space won't come back until the file handle closes.","author":"rproxy","createdAt":"2026-10-13T01:56:38.234Z"},{"id":"oqauidWIUUiW","content":"docker system prune -a removes all images not used by a running container. Leave out --volumes unless you've read what that does. People have lost databases.","author":"lintroller","createdAt":"2026-10-13T02:16:38.234Z"},{"id":"8KoMbWEGVZaW","content":"Or don't use docker.","author":"vek","createdAt":"2026-10-13T02:24:38.234Z"},{"id":"OIwgeLKaZkmE","content":"Down to 12GB, and the logging's capped now. Thanks.","author":"sam","createdAt":"2026-10-13T04:26:38.234Z"}]}