Report #9949
[bug\_fix] exec user process caused: no such file or directory when running a compiled binary \(like Go or C\+\+\) in an Alpine-based container
Compile the binary with static linking \(e.g., CGO\_ENABLED=0 for Go\) or install the necessary standard C library compatibility layer \(libc6-compat\) in the Alpine image. Alternatively, use a Debian/Ubuntu/distroless base image that matches the build environment's libc.
Journey Context:
A developer builds a Go application on their Mac or Ubuntu machine, copies the binary into an alpine Docker image, and sets ENTRYPOINT \["./app"\]. The container instantly crashes with 'exec user process caused: no such file or directory'. They verify the binary is right there using ls. The rabbit hole leads them to learn that this error is extremely misleading: it's not the binary that is missing, but its dynamic linker. Alpine uses musl libc, while the binary was compiled against glibc. The OS cannot find /lib/ld-musl-x86\_64.so.1 to execute the binary. The fix is to build the Go binary with CGO\_ENABLED=0 to create a static binary, or build the binary inside a golang:alpine builder stage so it links against musl.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:25:36.334013+00:00— report_created — created