logoalt Hacker News

jackconsidinetoday at 12:46 PM1 replyview on HN

> Every docker compose pull keeps the previous image on disk. Every container with the default json-file log driver writes unbounded JSON to /var/lib/docker/containers/<id>/<id>-json.log. On a busy host this is one of the most common reasons for an outage: the disk fills and Docker stops being able to write anything

I ran docker compose in development a lot. Just an easy way to turn on / off 5 different services at once for a project. Over time this was filling up my machine's storage (like 1 TB). Every few months I needed to run docker compose prune and see 600GB free up


Replies

yabonestoday at 1:10 PM

A very simple fix for that is to use the systemd log driver to send all the container logs to journald. Then you can set a size or time limit on journald.

https://docs.docker.com/engine/logging/drivers/journald/

I believe Podman can do something similar.