executable file not found in $PATH 🐳 Docker

OCI runtime create failed: exec: "x": executable file not found in $PATH

The command you asked the container to run doesn’t exist inside the image — wrong command name, a shell that isn’t installed (bash on Alpine), or a PATH problem.

Seen on: Docker

Meaning

CMD/ENTRYPOINT or the command after the image name is executed inside the container’s filesystem. Minimal images (alpine, distroless, scratch) don’t include bash, curl or even sh. The JSON form of CMD also doesn’t expand variables or use a shell.

Common causes

  • bash not installed (Alpine uses sh; distroless has no shell)
  • Typo in CMD/ENTRYPOINT or the run command
  • Binary installed to a directory not on PATH
  • Image name accidentally followed by an argument interpreted as the command

⚡ Quick fix

  1. Use sh instead of bash, or install bash
  2. Run the binary by absolute path
  3. Check what exists: docker run --rm image ls /usr/local/bin

Detailed fix by platform

Docker

  1. bash
    docker exec -it mycontainer sh            # Alpine: sh, not bash
    docker run --rm --entrypoint sh myimage -c 'echo $PATH; which node'

Dockerfile

  1. bash
    RUN apk add --no-cache bash   # if you really need bash on Alpine
    CMD ["node", "server.js"]

How to diagnose

  1. Command — What exactly is being executed?
  2. Image — Base image type (alpine/distroless/scratch)
  3. PATH — echo $PATH inside the container

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.