A production host ran out of disk space and the cause turned out to be container logs
Investigation shows /var/lib/docker/containers contains several multi-gigabyte -json.log files for a chatty service that's been running for months. Explain the root cause and the fix, including whether existing data needs cleanup. Expected reasoning: root cause is the default json-file driver with no rotation configured, so logs accumulated unbounded. Immediate fix: truncate or rotate the existing oversized log files (carefully, ideally restarting the container after setting rotation rather than truncating a file Docker has open); long-term fix: set max-size/max-file globally in daemon.json (o
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response