Docker Community Forums

Share and learn in the Docker community.

Docker Run - Error Permission Denied on CMD ["/node/execure.sh"]


(Sepigh) #1

When running a docker image I get Permission Denied error because of CMD ["/node/execure.sh"]. Details below:

  • Docker Version: 1.12.0-rc2
  • I am running on MacBook Pro 10.11.5
  • I am basing the image on ubuntu 14.04
  • I am setting it up for nodejs
  • I created a sample code (most basic nodejs app) to narrow it down to only dockerfile. Docker file is attached.
  • based on my investigation when I take out CMD ["/node/execute.sh"] from Dockerfile, the image runs ok, when put it in running the image fails with the following error message:
    docker: Error response from daemon: oci runtime error: exec: “/node/execute.sh”: permission denied.
  • the run command I run is below:
    docker run -i -t sepigh/node_helloworld:

(Tomasvasconcelos) #3

I had a similar problem and I have fixed it now.

Two things to pay attention to:

  • Make sure you have a shebang line at the top of your *.sh file
    shebang line in this case: #!/bin/sh

  • Make sure your file is marked as an executable. You can do that by adding this line to your Dockerfile:
    RUN [“chmod”, “+x”, "/node/execure.sh”]