Docker "OCI runtime exec failed: permission denied" (entrypoint not +x) in CI
When the entrypoint is a script without the executable bit, the OCI runtime cannot exec it and fails with permission denied. This commonly happens when a script is COPYed from a checkout whose mode bits were not preserved, or on a Windows-authored file.
What this error means
A container fails to start with OCI runtime exec failed: exec: "...": permission denied. The named entrypoint script is not marked executable.
docker
docker: Error response from daemon: OCI runtime create failed: runc create failed: unable to start container process: exec: "/entrypoint.sh": permission deniedCommon causes
The entrypoint script is not +x
A COPYed script that lost its executable bit cannot be exec'd by the runtime.
Mode bits not preserved on checkout
Files checked out on some platforms or archives can drop the executable bit.
How to fix it
chmod the entrypoint in the Dockerfile
- Copy the script, then mark it executable in a build step.
Dockerfile
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]Invoke via the interpreter to sidestep the mode bit
- Run the script through
sh/bashso the executable bit is not required.
Dockerfile
ENTRYPOINT ["sh", "/entrypoint.sh"]How to prevent it
- chmod +x entrypoint scripts during the build.
- Keep executable bits in version control (git update-index --chmod=+x).
- Prefer invoking via an interpreter when mode bits are unreliable.
Related guides
Docker "OCI runtime exec failed" - Fix docker exec Failures in CIFix Docker "OCI runtime exec failed: exec failed: ... executable file not found in $PATH" in CI - a docker ex…
Docker "standard_init_linux.go: ... no such file or directory" (Entrypoint) in CIFix Docker "standard_init_linux.go:<n>: exec user process caused: no such file or directory" in CI - an entry…
Docker ENTRYPOINT/CMD Shell Form - Signals Ignored, Container Won’t StopFix Docker containers that ignore SIGTERM and take 10s to stop in CI - a shell-form ENTRYPOINT/CMD wraps the…