# Docker "OCI runtime exec failed" - Fix docker exec Failures in CI

> Fix Docker "OCI runtime exec failed: exec failed: ... executable file not found in $PATH" in CI - a docker exec command that does not exist in the container or a stopped container.

Source: https://latchkey.dev/learn/docker/docker-oci-runtime-exec-failed  
Updated: 2026-06-25

`OCI runtime exec failed` comes from `docker exec`, not container startup. runc could not run the command you asked it to exec inside the container - usually because that binary is not in the image, or the container is not running.

## Diagnose it: read the container, not the compose file

A container that exits immediately in CI has almost always logged the reason and then been cleaned up. Capture the logs and the exit code before changing configuration.

```Terminal
# why did it stop?
docker ps -a --format '{{.Names}}\t{{.Status}}\t{{.Image}}'
docker logs <container> 2>&1 | tail -50
docker inspect <container> --format '{{.State.ExitCode}} {{.State.OOMKilled}} {{.State.Error}}'
```

> `OOMKilled: true` means the kernel killed it for memory, and no amount of application debugging will explain the log. Exit code 137 is the same event seen from outside.

## FAQ

### What causes Docker "OCI runtime exec failed"?

There are 3 common causes: the exec command is not in the image, the container is not running, and wrong path or a typo in the command. Calling docker exec ...

### How do I fix Docker "OCI runtime exec failed"?

There are 2 fixes depending on which cause you have: exec a shell the image actually has and confirm the container is running first. Work through them in order, since the first is the most common.

### What does Docker "OCI runtime exec failed" actually mean?

A docker exec <container> <cmd> fails with OCI runtime exec failed: exec failed: unable to start container process: exec "<cmd>": executable file not found in $PATH.

### How do I stop Docker "OCI runtime exec failed" happening again?

Use sh for exec on minimal images, or bake in the shell/tools you script against. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
