Q: How do you implement health checks in Docker?
In Dockerfile: HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/health || exit 1. Docker marks container as healthy o...
#Docker #Docker #L3 #Containers #Linux
🎙️ Candidate Opening & Architectural Context
""In an interview, I explain how we diagnosed container runtime failures without guessing. 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
In Dockerfile: HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/health || exit 1. Docker marks container as healthy or unhealthy. Compose and orchestrators use this for readiness.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: In Dockerfile: HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/health || exit 1. Docker marks container as he."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: In Dockerfile: HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/health || e
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement