Docker exec: "/": permission denied: unknown. How to fix it?

I type docker run

docker run --name www_app -d -p 443:443 alpine-apache:latest

But getting the error:

 docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/": permission denied: unknown.
ERRO[0000] error waiting for container: context canceled c

Do I need to add following in my Dockerfile?

RUN chmod 0700

What is the best practice here?

You need executable permission on the file. Yes, that or set up permission on the host (where you have Dockerfile and using the chmod command. Like:

chmod +x

Then rebuild it:

docker build -t  alpine-apache .

Run it:

docker run --name www_app -d -p 443:443 alpine-apache:latest

It should work now.

1 Like

So simple solution. Why I didn’t thought of it? Many thanks.

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki