Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

acoustic85's avatar

Permission denied for a .sh script in Docker

Hi Everyone,

I am working on MAC OS and I am trying to run a script from my app container but I am ending up with persmission denied after I run compose-build up.


This is is the line :
CMD ./start_script.sh

If anyone can give me any help regrading this I very thankfull.

Thank you very much in advance.

0 likes
6 replies
Sinnbeck's avatar

First of. Are you sure that the file is available in the work directory of the container?

Try full path and in "array"

CMD ["/full/path/to/start_script.sh"]
robertldeboer's avatar

If this is a bash script #!/bin/sh then try running it as bash ./start_script.sh

I have found that depending on system setup, permissions, and security you somethings need to run the command as above. There are ways to fix it so you don't have to but to just get it to run try the above.

acoustic85's avatar

Yes it is a bash script I will try and let you know

Please or to participate in this conversation.