How do you handle a "no space left on device" on a Docker host?
IntermediateProductionResource Limits, Health & Reliability
Answer
df -h /var/lib/docker; docker system df
du -sh /var/lib/docker/containers/*/*-json.log | sort -h | tail
docker builder prune -af && docker image prune -af --filter until=168h
truncate -s 0 /var/lib/docker/containers/<id>/<id>-json.log # emergency
Also check inodes (df -i). Prevent with log rotation, scheduled pruning, and monitoring.
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced