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?
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?
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.
Sounds like run.sh is not executable. Have you set the executable bit for run.sh (like chmod +x run.sh
)?