Q: How do you debug a container that crashes before you can exec into it?
Override the entrypoint to sleep: docker run --entrypoint sleep myimage 300. Then exec in and investigate. Or: docker run --entrypoint /b...
#Docker #Docker #L3 #Containers #Linux
🎙️ Candidate Opening & Architectural Context
""When containerizing our microservices stack, container lifecycle and resource management were critical. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Production Solution & Architecture
Override the entrypoint to sleep: docker run --entrypoint sleep myimage 300. Then exec in and investigate. Or: docker run --entrypoint /bin/sh -it myimage to get a shell without running the main app.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Override the entrypoint to sleep: docker run --entrypoint sleep myimage 300. Then exec in and investigate. Or: docker run --entryp."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: Override the entrypoint to sleep: docker run --entrypoint sleep myimage 300. Then exec in and i
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement