How to fix Docker exec: Entrypoint: Permission Denied: Unknown

My experience fixing a Docker issue that refused to run an entrypoint script, which turned out to be very simple to fix.

One time, a client asked me to self-host an app called SerpBear, a Search Engine Position Rank Tracking App.

Back then I self-hosted the SerpBear v2.0.7. The app was great but was missing a feature my client needed.

So I cloned the Git repository, analyzed it, and made some changes.

I was ready to deploy the modified version of SerpBear to our Linux server, and my plan was to deploy it using Docker.

Since the source code was already modified, I needed to rebuild a new Docker image.

docker build .

Once the new image was built, I tried to create a new container using it.

But when I tried to run the Docker container, I got this error:

⠙ Container serpbear Starting 0.1s Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: “/app/entrypoint.sh”: permission denied: unknown

I wasn’t sure what caused this.

At first, I thought there was something wrong with my Docker installation.

But then I checked the /app/entrypoint.sh file and found the source of the issue.

You see, the problem was that entrypoint.sh didn’t have executable permissions.

So, to fix it, I just added executable permission using chmod.

chmod +x entrypoint.sh

Once I added the executable permission, I rebuilt the Docker image and ran a container based on it.

This time, the modified SerpBear Docker app ran normally without any issues.

I wish Docker had told me why it didn’t work.

The error message wasn’t very obvious.

Anyway, thanks for reading this short post.

As usual, if you have any questions or a better method, leave a comment below.

Thanks for reading, and see you next time!