Interview Prep/Docker/Volumes, storage and data

Disk shows 95% full on `/var/lib/docker`. What do you check in order?

IntermediateScenarioVolumes, storage and data
Answer

Situation read → Typically images, build cache, container logs or volumes.

What I'd do →

docker system df -v
du -xh --max-depth=2 /var/lib/docker | sort -h | tail
ls -lhS /var/lib/docker/containers/*/*-json.log | head

Then prune images/build cache, truncate offending logs (truncate -s 0 <file>), and set max-size/max-file log options.

Why → The json-file driver has no rotation by default.

Interview tip → Fix the cause (log rotation), not only the symptom.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data