Skip to content
Latchkey

Docker "standard_init_linux.go: exec format error" in CI

runc could not exec the user process. The classic causes are an image built for a different CPU architecture, or an entrypoint script with no shebang so the kernel cannot tell how to run it.

What this error means

A container start fails with standard_init_linux.go:... exec user process caused: exec format error, often immediately after launch.

docker
standard_init_linux.go:228: exec user process caused: exec format error

Common causes

Architecture mismatch

An arm64 image run on amd64 (or vice versa) without emulation cannot execute its binaries.

Script missing a shebang

An entrypoint script set as ENTRYPOINT without a #!/bin/sh line has no interpreter, so exec fails.

Windows line endings on the script

CRLF line endings corrupt the shebang line, making the interpreter unresolvable.

How to fix it

Fix the script

  1. Add a shebang as the first line and use LF line endings.
  2. Mark the script executable.
entrypoint.sh
#!/bin/sh
set -e
exec "$@"

Match or emulate the architecture

  1. Build/run for the host architecture, or set up QEMU for cross-arch.
.github/workflows/build.yml
- uses: docker/setup-qemu-action@v3

How to prevent it

  • Keep entrypoint scripts LF-terminated with a shebang and executable bit, and match image architecture to the host (or set up QEMU). This is deterministic, not transient.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →