Docker "container_linux.go: exec format error" at container start in CI
A container's entrypoint must be a binary the host CPU can execute. exec format error at start means the image (or the entrypoint binary inside it) was built for a different architecture - for example an arm64 image run on an amd64 runner, or vice versa.
What this error means
A container exits immediately with standard_init_linux.go / container_linux.go: starting container process caused: exec format error. The image arch does not match the host.
docker
standard_init_linux.go:228: exec user process caused: exec format error
# the image was built for linux/arm64 but the host is linux/amd64Common causes
Image built for a different architecture
An arm64 image pulled or built then run on an amd64 host (or the reverse) cannot exec its entrypoint.
A misconfigured --platform
Forcing --platform to an arch the host cannot run produces an exec format error at start.
How to fix it
Build/pull for the host architecture
- Match the image platform to the runner architecture.
- For CI on amd64 runners, target linux/amd64.
Terminal
docker buildx build --platform linux/amd64 -t myorg/api:1.4.2 --load .
docker run --rm myorg/api:1.4.2Enable emulation for cross-arch runs
- Install QEMU binfmt so the host can run other architectures.
Terminal
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --rm --platform linux/arm64 myorg/api:1.4.2How to prevent it
- Match image platform to the runner architecture.
- Use multi-arch manifests so the right variant is pulled.
- Install QEMU binfmt when you must run cross-arch.
Related guides
Docker "exec format error" - Fix Architecture Mismatch in CIFix Docker "exec /entrypoint: exec format error" in CI - running an image built for a different CPU architect…
Docker "exec format error" from wrong architecture in CIFix the Docker "exec format error" in CI builds and runs, caused by running an image built for a different CP…
Docker "standard_init_linux.go: exec format error" in CIFix the Docker "standard_init_linux.go: exec format error" in CI, caused by an architecture mismatch or an en…