Report #91745
[bug\_fix] standard\_init\_linux.go:228: exec user process caused: no such file or directory \(or exec format error\) when running a container built with a multi-stage copy from a golang builder to an Alpine base.
Compile the Go binary with \`CGO\_ENABLED=0\` to create a statically linked executable, or use an Alpine-based builder image \(e.g., \`golang:alpine\`\) so the binary links against musl libc instead of glibc.
Journey Context:
A Go developer creates a multi-stage Dockerfile. Stage 0 uses \`golang:1.20\` \(Debian-based\) to compile the binary, and Stage 1 uses \`alpine:3.18\` to run it. Upon running the container, it instantly crashes with 'exec user process caused: no such file or directory'. The developer is baffled because the binary exists and has execute permissions. They use \`ldd\` on the binary in the builder stage and discover it is dynamically linked against glibc. Alpine uses musl libc, not glibc, so the dynamic linker is missing. The fix is to add \`CGO\_ENABLED=0\` to the \`go build\` command to produce a static binary, or change the builder image to \`golang:1.20-alpine\` so it compiles against musl.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:35:08.483775+00:00— report_created — created