advancedScenario-Based & System Design Questions
A container that worked fine locally fails immediately in production with 'exec format error'.
This almost always indicates an architecture mismatch — the image was built for a different CPU architecture than the production host (e.g., built on Apple Silicon/ARM and deployed to an x86_64 host, or vice versa). Diagnose with `docker inspect --format='{{.Architecture}}'` on the image, and fix by building multi-architecture images (`docker buildx build --platform linux/amd64,linux/arm64`) or explicitly targeting the correct platform at build time.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response