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.
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.
Check if the file exists inside the container:
# 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:
docker create --name temp <image_name>
docker export temp | tar -tvf - | grep <executable_name>
docker rm tempReview your Dockerfile for correct executable paths:
# 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 --flagEnsure the path matches exactly where the file is in the image.
Ensure the file has execute permissions:
# In Dockerfile
COPY --chmod=755 myapp /app/myapp
# Or add chmod step
COPY myapp /app/myapp
RUN chmod +x /app/myappFor scripts, also ensure they have proper shebang lines.
If using just the executable name, ensure it is in PATH:
# 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.
In multi-stage builds, ensure you copy the binary to the final stage:
# 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.
Temporarily override to investigate:
# 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 $PATHScratch 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.
image operating system "linux" cannot be used on this platform
How to fix 'image operating system linux cannot be used on this platform' in Docker
manifest unknown: manifest unknown
How to fix 'manifest unknown' in Docker
cannot open '/etc/passwd': Permission denied
How to fix 'cannot open: Permission denied' in Docker
Error response from daemon: failed to create the ipvlan port
How to fix 'failed to create the ipvlan port' in Docker
toomanyrequests: Rate exceeded for anonymous users
How to fix 'Rate exceeded for anonymous users' in Docker Hub