Skip to content
Latchkey

Docker "failed to create shim task: OCI runtime create failed: executable file not found"

containerd’s shim could not start the container because the command it was told to run does not exist on PATH inside the image. The entrypoint/CMD names a binary the image does not have.

What this error means

A docker run/compose up fails with failed to create shim task: OCI runtime create failed: ... exec: "<cmd>": executable file not found in $PATH. The container never starts because its command cannot be resolved.

docker run output
Error response from daemon: failed to create shim task: OCI runtime create
failed: runc create failed: unable to start container process: exec:
"yarn": executable file not found in $PATH: unknown

Common causes

The CMD/ENTRYPOINT binary is not installed

The image lacks the named tool (e.g. yarn, python, a custom script) because it was never installed in the final stage or was dropped in a multi-stage build.

The binary is not on PATH

The executable exists but lives outside the directories in $PATH, so the shim cannot find it by bare name.

A typo or wrong shell form in CMD

A misspelled command, or exec-form CMD pointing at a path that does not exist, resolves to nothing the runtime can exec.

How to fix it

Confirm the command exists in the final image

Open a shell in the image and check the binary resolves.

Terminal
docker run --rm -it --entrypoint sh myorg/api:1.4.2 -c 'command -v yarn || echo missing'

Install the binary or fix the command/PATH

Make sure the tool is present in the final stage and on PATH.

Dockerfile
# install in the final stage, not just a builder stage
RUN corepack enable && corepack prepare yarn@stable --activate
# or reference an absolute path / fix the typo in CMD
CMD ["/usr/local/bin/yarn", "start"]

How to prevent it

  • Install runtime binaries in the final stage, not only in builder stages.
  • Smoke-test images with docker run --rm <image> before publishing.
  • Use absolute paths or verify PATH for entrypoint commands.

Frequently asked questions

What causes ""failed to create shim task""?
The image lacks the named tool (e.g. yarn, python, a custom script) because it was never installed in the final stage or was dropped in a multi-stage build.
How do I fix "failed to create shim task"?
Open a shell in the image and check the binary resolves.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card