⚡ ~/naveed Interview Prep
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 998+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
Staff SRE / Principal Architect [L3] Docker Must enable BuildKit Staff SRE Scenario [L3]

Q: After months of daily Docker builds, your production server's disk is full. You run `docker system prune -af` and reclaim some space, but the disk is still 90% full. `docker system df` shows minimal usage. Where is the hidden disk consumption?

docker system prune only removes objects tracked by the Docker daemon (images, containers, volumes, build cache). If the Docker daemon cr...

#Docker #Must enable BuildKit #L3 #Containers #Linux
🎙️ Candidate Opening & Architectural Context
""When containerizing our microservices stack, container lifecycle and resource management were critical. The interviewer is testing: overlay2 layer directory orphans, `/var/lib/docker` internals.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement

🛠️ Production Runbook & Step-by-Step Resolution

1️⃣

Production Solution & Architecture

docker system prune only removes objects tracked by the Docker daemon (images, containers, volumes, build cache). If the Docker daemon crashed or was force-killed during container operations, orphaned layer directories can accumulate in /var/lib/docker/overlay2/ that the daemon no longer tracks. *Diagnosis:* Run du -sh /var/lib/docker/overlay2/ and compare with docker system df. A large discrepancy confirms orphaned layers. *Fix:* The safest approach is to stop the Docker daemon (systemctl stop docker), back up any critical volumes, and reset the storage entirely (rm -rf /var/lib/docker). Restarting Docker recreates the directory structure. Re-pull needed images. For prevention, ensure the Docker daemon shuts down gracefully and monitor /var/lib/docker disk usage independently.

💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: docker system prune only removes objects tracked by the Docker daemon (images, containers, volumes, build cache). If the Docker da."
⚡ 60-Second Elevator Pitch Talking Points
  • Immediate Triage: docker system prune only removes objects tracked by the Docker daemon (images, containers, volu
  • Run targeted verification commands before modifying configuration.
  • Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement
Want more Docker scenarios?
Explore our complete collection of scenario-based Docker interview runbooks.
Browse All Docker Questions →

📚 Related Production Scenarios in Docker