📖 ~1 min read
Table of contents
Symptom & Impact
Administrators observe: Ubuntu 26.04 LTS – Docker overlay2 fills root disk and containers fail to start. Deployments fail with no space left errors.
Environment & Reproduction
Issue appears on hosts with unbounded image retention, logs, and stopped container artifacts.
# Baseline context
lsb_release -a
df -h
du -sh /var/lib/docker/* 2>/dev/null | sort -h
docker system df
sudo journalctl -u docker -n 100 --no-pager
Root Cause Analysis
Unused image layers, build cache, and container logs accumulate in overlay2 until root partition is exhausted.
Quick Triage
Identify top storage consumers and safe reclaim targets.
# Quick triage
docker ps -a --size
docker images --digests
sudo find /var/lib/docker/containers -name '*-json.log' -printf '%s %p
' | sort -nr | head -n 20
Step-by-Step Diagnosis
Correlate container lifecycle with image/cache growth patterns.
# Detailed diagnosis
docker system df -v
sudo du -xh /var/lib/docker/overlay2 | sort -h | tail -n 50
sudo journalctl -u docker --since '7 days ago' --no-pager | tail -n 200

Solution – Primary Fix
Prune unused objects and configure log rotation.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
# Primary fix
docker system prune -af --volumes
sudo tee /etc/docker/daemon.json >/dev/null <<'EOF'
{
"log-driver": "json-file",
"log-opts": {
"max-size": "20m",
"max-file": "3"
}
}
EOF
sudo systemctl restart docker

Solution – Alternative Approaches
Move Docker data root to larger dedicated volume.
# Alternative
sudo systemctl stop docker
sudo rsync -aHAX /var/lib/docker/ /mnt/docker-data/
sudo mkdir -p /etc/docker
echo '{"data-root": "/mnt/docker-data"}' | sudo tee /etc/docker/daemon.json
sudo systemctl start docker
Verification & Acceptance Criteria
Disk usage returns to safe level and containers start successfully.
# Verify
df -h
docker system df
docker run --rm hello-world
Rollback Plan
Restore prior daemon config and data-root if container runtime regressions appear.
# Rollback
sudo cp -a /etc/docker/daemon.json /etc/docker/daemon.json.rollback.$(date +%F)
sudo systemctl restart docker
Prevention & Hardening
Apply retention policies for images and logs in CI/CD pipelines.
# Hardening
docker image prune -af
docker builder prune -af
crontab -l | grep -i docker || true
Related Errors & Cross-Refs
Related patterns include failed to register layer and write /var/lib/docker/… no space left on device.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Docker storage driver documentation and Ubuntu container host hardening guidance.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.