Skip to content
Latchkey

Docker "standard_init_linux: exec user process caused permission denied" in CI

When the runtime tries to exec the container entrypoint and the file lacks the executable bit (or a script has a bad interpreter line), the kernel returns EACCES and the container dies at startup with "exec user process caused: permission denied".

What this error means

A container exits immediately with standard_init_linux.go:228: exec user process caused: permission denied.

docker
standard_init_linux.go:228: exec user process caused: permission denied

Common causes

The entrypoint file is not executable

A COPYed script or binary without the +x bit cannot be exec'd.

A script copied from a non-exec host file

Files copied from Windows or an archive often lose the executable bit.

A bad shebang on a wrapper script

A shebang pointing at an interpreter that is not present can surface as a permission/exec failure.

How to fix it

Set the executable bit during build

  1. Use COPY --chmod (BuildKit) or a RUN chmod to make the entrypoint executable.
Dockerfile
COPY --chmod=755 entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

Fix the interpreter line for scripts

  1. Ensure the shebang points at a shell present in the image.
entrypoint.sh
#!/bin/sh
exec "$@"

How to prevent it

  • Mark entrypoints executable at build time with --chmod or RUN chmod.
  • Verify the shebang interpreter exists in the target base image.

Related guides

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