0

I have this in a Dockerfile

WORKDIR /app
COPY run.sh .
ENTRYPOINT ./run.sh

it says it cant find run.sh, but when I do

WORKDIR /app
COPY run.sh .
ENTRYPOINT bash run.sh

then it works. Why would this be?

2 Answers2

0

I could make it work using the first Dockerfile, but I needed to set execute permissions for run.sh. This works:

FROM alpine
WORKDIR /app
COPY run.sh .
RUN chmod +x run.sh
ENTRYPOINT ./run.sh

Check if that works for you. The second version works without the permissions because it is straight passed to the bash interpreter, which will not check for the executable flag.

Marc Sances
  • 2,402
  • 1
  • 19
  • 34
0

Sounds like run.sh is not executable. Have you set the executable bit for run.sh (like chmod +x run.sh)?

bjoluc
  • 51
  • 3