How to fix OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "app": executable file not found in $PATH in Docker

DockerINTERMEDIATEMEDIUMUpdated Dec 6, 2025ยท 155 views

The command or entrypoint specified cannot be found in the container. Check that the executable exists in the image, is in PATH, and has correct permissions.

Quick fix

Fixes OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "app": executable file not found in $PATH

# Start a shell in the image to explore
docker run -it --entrypoint /bin/sh <image_name>

# Or with bash if available
docker run -it --entrypoint /bin/bash <image_name>

# Then check if the file exists
ls -la /path/to/expected/executable
which <executable_name>
  1. Verify the executable exists in the image
  2. Check the Dockerfile CMD and ENTRYPOINT
  3. Verify executable permissions
  4. Check PATH environment variable
docker โ€” error
# Start a shell in the image to explore
docker run -it --entrypoint /bin/sh <image_name>
# Or with bash if available
docker run -it --entrypoint /bin/bash <image_name>
# Then check if the file exists
ls -la /path/to/expected/executable
which <executable_name>
OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "app": executable file not found in $PATH

What this error means

This error occurs when Docker (specifically the OCI runtime like runc or containerd) cannot find the executable specified as the entrypoint or command for the container. The file either does not exist in the container filesystem, is not in any directory listed in PATH, or lacks execute permissions. OCI (Open Container Initiative) is the standard runtime specification. This error comes from the low-level container runtime when it fails to start the container process.

Typical symptoms

  • Container fails to start with OCI runtime error
  • Error message shows the missing executable name
  • docker run exits immediately with status code 127
  • Same image may work with a different command
  • Build succeeds but run fails

Common causes

  1. Executable was not installed or copied into the image
  2. CMD or ENTRYPOINT references a typo or wrong path
  3. Binary is present but not executable (wrong permissions)
  4. Script shebang points to missing interpreter
  5. Multi-stage build did not copy the binary to final image
  6. PATH environment variable does not include the binary location
  7. Using shell form instead of exec form in ENTRYPOINT

How to fix "OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "app": executable file not found in $PATH"

1Verify the executable exists in the image

Check if the file exists inside the container:

bash
# Start a shell in the image to explore
docker run -it --entrypoint /bin/sh <image_name>

# Or with bash if available
docker run -it --entrypoint /bin/bash <image_name>

# Then check if the file exists
ls -la /path/to/expected/executable
which <executable_name>

If the image has no shell, use another image to inspect:

bash
docker create --name temp <image_name>
docker export temp | tar -tvf - | grep <executable_name>
docker rm temp
2Check the Dockerfile CMD and ENTRYPOINT

Review your Dockerfile for correct executable paths:

dockerfile
# Exec form (preferred) - requires full path or PATH lookup
ENTRYPOINT ["/app/myapp"]
CMD ["--flag"]

# Shell form - runs through /bin/sh -c
ENTRYPOINT /app/myapp
CMD --flag

Ensure the path matches exactly where the file is in the image.

3Verify executable permissions

Ensure the file has execute permissions:

dockerfile
# In Dockerfile
COPY --chmod=755 myapp /app/myapp

# Or add chmod step
COPY myapp /app/myapp
RUN chmod +x /app/myapp

For scripts, also ensure they have proper shebang lines.

4Check PATH environment variable

If using just the executable name, ensure it is in PATH:

dockerfile
# Add directory to PATH
ENV PATH="/app:$PATH"

# Then you can use just the name
ENTRYPOINT ["myapp"]

Or use the full absolute path in ENTRYPOINT.

5Fix multi-stage build copy issues

In multi-stage builds, ensure you copy the binary to the final stage:

dockerfile
# Build stage
FROM golang:1.21 AS builder
WORKDIR /src
COPY . .
RUN go build -o /app/myapp

# Final stage
FROM alpine:latest
# IMPORTANT: Copy the built binary
COPY --from=builder /app/myapp /app/myapp
ENTRYPOINT ["/app/myapp"]

Without the COPY, the final image has no binary.

6Override entrypoint to debug

Temporarily override to investigate:

bash
# Run with shell to explore
docker run -it --entrypoint sh <image_name>

# Check what is in the container
ls -la /
cat /etc/os-release
echo $PATH

Advanced notes

Scratch Images: If using FROM scratch (distroless), there is no shell. You must use exec form ["/app"] and ensure the binary is statically compiled.

Alpine and musl: Binaries compiled on glibc systems (Ubuntu, Debian) may not work on Alpine (musl). Either compile on Alpine or use static linking: CGO_ENABLED=0 go build.

Exec vs Shell Form: Exec form ["cmd", "arg"] runs directly. Shell form cmd arg runs via /bin/sh -c. If your image has no shell, you must use exec form.

Frequently asked questions

What does "OCI runtime create failed: container_linux.go:380: starting container" mean?
This error occurs when Docker (specifically the OCI runtime like runc or containerd) cannot find the executable specified as the entrypoint or command for the container. The file either does not exist in the container filesystem, is not in any directory listed in PATH, or lacks execute permissions. OCI (Open Container Initiative) is the standard runtime specification.
How do I fix "OCI runtime create failed: container_linux.go:380: starting container"?
The command or entrypoint specified cannot be found in the container. Check that the executable exists in the image, is in PATH, and has correct permissions.
What causes "OCI runtime create failed: container_linux.go:380: starting container"?
Executable was not installed or copied into the image CMD or ENTRYPOINT references a typo or wrong path Binary is present but not executable (wrong permissions)
Is the "OCI runtime create failed: container_linux.go:380: starting container" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading