Q: How do you make sure containers restart on host reboot?
docker run --restart=unless-stopped — restarts always except when manually stopped. Or --restart=always. Docker Compose: restart: unless-...
#Docker #Docker #L2 #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
docker run --restart=unless-stopped — restarts always except when manually stopped. Or --restart=always. Docker Compose: restart: unless-stopped in the service definition.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: docker run --restart=unless-stopped — restarts always except when manually stopped. Or --restart=always. Docker Compose: restart: ."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: docker run --restart=unless-stopped — restarts always except when manually stopped. Or --restar
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement