Interview Prep/Docker/Resource Limits, Health & Reliability

How do you stop logs from filling the disk?

BeginnerProductionResource Limits, Health & Reliability
Answer

json-file has no rotation by default. Set limits globally:

{ "log-driver": "local", "log-opts": { "max-size": "10m", "max-file": "5" } }

Existing containers need recreating to pick up changes. Disk-full from /var/lib/docker/containers/*/*-json.log is one of the most common production incidents.

All Docker questions Roadmap: Docker & containers

More on Resource Limits, Health & Reliability