Report #100079
[bug\_fix] exec /usr/local/bin/node: exec format error when running an image built for a different architecture
Use Docker Buildx with QEMU/binfmt emulation: \`docker buildx create --use\` then \`docker buildx build --platform linux/amd64,linux/arm64 -t myimage .\`. To run an image locally on a non-native architecture, ensure qemu-user-static/binfmt\_misc is registered \(\`docker run --privileged --rm tonistiigi/binfmt --install all\`\). For production, build natively or use cross-compilation instead of emulation for reliability.
Journey Context:
You develop on an Apple Silicon Mac and build \`docker build -t myapp .\`, then deploy to a linux/amd64 Kubernetes cluster. Pods crash with 'exec format error'. You realize BuildKit without --platform built a native arm64 image. You install Docker Desktop's Rosetta setting, but it still fails on Linux CI. The correct approach is to create a buildx builder and specify target platforms. Buildx can use QEMU user-mode emulation for foreign architectures, though cross-compilation toolchains are faster and more reliable for compiled languages.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:36:56.629252+00:00— report_created — created