Docker "OCI runtime create failed: exec: <cmd>: not found" in CI
The container could not start because its command binary is missing. OCI runtime create failed: ... exec: "<cmd>": executable file not found in $PATH means the entrypoint/CMD references a program that is not installed in the image or not on PATH.
What this error means
A docker run or docker compose up fails with Cannot start service <svc>: OCI runtime create failed: ... exec: "<cmd>": executable file not found in $PATH: unknown. The image starts fine with a command that exists.
Error response from daemon: failed to create task for container: failed to create shim task:
OCI runtime create failed: ... exec: "node": executable file not found in $PATH: unknownCommon causes
The command is not installed in the image
An ENTRYPOINT/CMD referencing a binary the image never installed (e.g. node on a minimal base) cannot be exec'd.
The binary is not on PATH
A program installed in a non-standard directory that is not on $PATH is reported as not found.
A shell-only command run in exec form
Exec-form CMD ["foo && bar"] looks for a literal binary foo && bar; shell operators need a shell, not exec form.
How to fix it
Install the binary and verify PATH
Ensure the command exists in the image and is on PATH.
RUN which node || (echo "node missing" && exit 1)
# use a base image that includes it, e.g. FROM node:20-slimUse the right CMD form
For shell operators, use shell form or wrap in sh -c.
# exec form needs a real binary:
CMD ["node", "server.js"]
# shell operators need a shell:
CMD ["sh", "-c", "node migrate.js && node server.js"]How to prevent it
- Install every command the entrypoint/CMD needs in the image.
- Use shell form (or
sh -c) only when you need shell operators. - Verify key binaries with
whichduring the build.