docker
runtime_error
ai_generated
true
docker: Error response from daemon: OCI runtime create failed: container_linux.go: starting container process caused: exec: "/entrypoint.sh": stat /entrypoint.sh: no such file or directory
ID: docker/entrypoint-script-not-found
92%Fix Rate
90%Confidence
1Evidence
2024-04-12First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Docker 20.10.0 | active | — | — | — |
| Docker 24.0.0 | active | — | — | — |
| Docker 25.0.0 | active | — | — | — |
| Docker CE 26.0.0 | active | — | — | — |
Root Cause
The Dockerfile specifies an ENTRYPOINT or CMD that references a script file (e.g., /entrypoint.sh) that does not exist inside the container image.
generic中文
Dockerfile 指定的 ENTRYPOINT 或 CMD 引用了容器镜像中不存在的脚本文件(例如 /entrypoint.sh)。
Official Documentation
https://docs.docker.com/engine/reference/builder/#entrypointWorkarounds
-
95% success Ensure the entrypoint script is copied into the image. Add a COPY instruction in the Dockerfile: 'COPY entrypoint.sh /entrypoint.sh' and ensure the file exists in the build context. Example: 'COPY ./scripts/entrypoint.sh /entrypoint.sh'.
Ensure the entrypoint script is copied into the image. Add a COPY instruction in the Dockerfile: 'COPY entrypoint.sh /entrypoint.sh' and ensure the file exists in the build context. Example: 'COPY ./scripts/entrypoint.sh /entrypoint.sh'.
-
90% success If the entrypoint is defined in docker-compose.yml, verify the path is correct relative to the container filesystem. Use 'docker run --entrypoint /bin/sh <image>' to inspect the container and confirm the file exists.
If the entrypoint is defined in docker-compose.yml, verify the path is correct relative to the container filesystem. Use 'docker run --entrypoint /bin/sh <image>' to inspect the container and confirm the file exists.
中文步骤
Ensure the entrypoint script is copied into the image. Add a COPY instruction in the Dockerfile: 'COPY entrypoint.sh /entrypoint.sh' and ensure the file exists in the build context. Example: 'COPY ./scripts/entrypoint.sh /entrypoint.sh'.
If the entrypoint is defined in docker-compose.yml, verify the path is correct relative to the container filesystem. Use 'docker run --entrypoint /bin/sh <image>' to inspect the container and confirm the file exists.
Dead Ends
Common approaches that don't work:
-
90% fail
Adding 'RUN chmod +x /entrypoint.sh' in the Dockerfile does not help if the file is not copied into the image in the first place.
-
80% fail
Using an absolute path like '/entrypoint.sh' when the file is in a relative directory (e.g., './entrypoint.sh') causes the same error because the file is not at the expected location.