Report #3077
[bug\_fix] exec user process caused: exec format error when running docker run on a deployment server.
Build the image explicitly for the target architecture using docker build --platform linux/amd64 ... or use docker buildx to cross-compile the image for the correct target OS and architecture.
Journey Context:
A developer builds a Docker image on their new Apple Silicon \(ARM64\) Mac. It runs perfectly locally. They push it to a registry and deploy to an AWS EC2 instance or Kubernetes cluster running on AMD64 nodes. The pod crashes immediately with exec format error. They spend hours checking file permissions, entrypoint paths, and shell formats \(CRLF vs LF\). Eventually, they inspect the image locally with docker inspect and see Architecture: arm64. The Linux kernel on the AMD64 node cannot execute an ARM64 binary. The fix is to use docker buildx build --platform linux/amd64 to cross-compile the image for the target deployment architecture. This works because it instructs QEMU \(via BuildKit\) to emulate the target architecture during the build, ensuring the compiled binaries inside the container match the host OS CPU architecture where it will be run.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T15:20:02.661675+00:00— report_created — created