Docker "container_linux.go: starting container process caused" in CI
container_linux.go: ... starting container process caused is the older runc phrasing for a container that failed to start. Like the newer "OCI runtime create failed", the real reason is the text after the colon.
What this error means
A docker run on an older runtime fails with container_linux.go:<n>: starting container process caused "<reason>". The wrapper is generic; the quoted reason (missing exec, bad chdir, permission) is the actual problem.
docker: Error response from daemon: OCI runtime create failed:
container_linux.go:380: starting container process caused: exec:
"/app/run.sh": permission denied: unknown.Common causes
"permission denied" - entrypoint not executable
The entrypoint script lacks the execute bit, so runc cannot exec it. Common when a script is COPYed without chmod +x.
"exec: ... no such file or directory" - missing target/interpreter
The command, or its shebang interpreter, is not present in the image (or the script has CRLF line endings), so the process cannot start.
"chdir ... no such file or directory" - bad WORKDIR
A WORKDIR/working-dir that does not exist in the image makes runc fail before the process runs.
How to fix it
Read the quoted reason and fix it
- For "permission denied", add the execute bit to the entrypoint (
chmod +x). - For "no such file or directory", confirm the binary/interpreter exists and the script uses LF endings.
- For a chdir error, make sure the working directory exists in the image.
Make the entrypoint executable in the Dockerfile
COPY run.sh /app/run.sh
RUN chmod +x /app/run.sh && sed -i 's/\r$//' /app/run.sh
ENTRYPOINT ["/app/run.sh"]How to prevent it
- Set the execute bit on entrypoint scripts and enforce LF endings.
- Ensure WORKDIR paths exist in the image.
- Smoke-test the container start in CI before publishing the image.