Q: You are investigating an incident. How do you find the exact time a container was created, started, and stopped down to the millisecond?
You would use the docker inspect command to query the detailed metadata json.
#Docker #Docker #L1 #Containers #Linux #Terraform State
🎙️ Candidate Opening & Architectural Context
""Container stability relies on clean signal handling (SIGTERM vs SIGKILL) and immutable image tagging. The interviewer is testing: `docker inspect` parsing.. 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
You would use the docker inspect command to query the detailed metadata json. You can parse it cleanly using the go-template format flag: docker inspect --format='{{.State.StartedAt}} :: {{.State.FinishedAt}}' . This bypasses manually scrolling through massive JSON outputs.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: You would use the docker inspect command to query the detailed metadata json.."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: You would use the docker inspect command to query the detailed metadata json.
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement