Q: How do you pass build arguments (not environment variables) to a Docker build?
ARG VERSION=latest in Dockerfile. Build: docker build --build-arg VERSION=1.2.3 .. ARG values are available only at build time, not at ru...
#Docker #Docker #L2 #Containers #Linux
🎙️ Candidate Opening & Architectural Context
""Container stability relies on clean signal handling (SIGTERM vs SIGKILL) and immutable image tagging. 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
ARG VERSION=latest in Dockerfile. Build: docker build --build-arg VERSION=1.2.3 .. ARG values are available only at build time, not at runtime (use ENV for runtime). Don't pass secrets via ARG — they appear in image history.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: ARG VERSION=latest in Dockerfile. Build: docker build --build-arg VERSION=1.2.3 .. ARG values are available only at build time, no."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: ARG VERSION=latest in Dockerfile. Build: docker build --build-arg VERSION=1.2.3 .. ARG values a
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement