Q: How do you get a shell inside a running container?
docker exec -it <container> bash or sh if bash isn't available.
#Docker #Docker #L1 #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
docker exec -it or sh if bash isn't available.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: docker exec -it bash or sh if bash isn't available.."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: docker exec -it bash or sh if bash isn't available.
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement