exec /entrypoint.sh: permission denied (container won't start)
The entrypoint or command isn’t marked executable inside the image, or it’s on a volume mounted noexec.
Seen on:
Docker
Meaning
Files copied from Windows or from a repo without the executable bit end up mode 644 in the image. Bind-mounting the source folder over the image can also replace an executable script with a non-executable host copy.
Common causes
- Script copied without the executable bit
- Bind mount overrides the file with a host copy lacking +x
- Volume/tmpfs mounted with noexec
- Running as a non-root USER without read/execute permission
⚡ Quick fix
- chmod +x in the Dockerfile (or COPY --chmod=755)
- Commit the executable bit: git update-index --chmod=+x
- Run via the interpreter: ["sh", "/entrypoint.sh"]
Detailed fix by platform
Dockerfile
- bash
COPY --chmod=755 entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
How to diagnose
- Mode — docker run --rm --entrypoint ls image -l /entrypoint.sh
- Mounts — Is the path bind-mounted from the host?
- User — Which USER runs it?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Docker
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026