Not able to run a bash script [Solved]

Hi,
A month or so ago I used to run a bash script using the following Dockerfile

FROM ubuntu:20.04

RUN useradd -ms /bin/sh galileo
USER galileo
WORKDIR /home/galileo

COPY . .

USER root

RUN chmod a+x sim.sh
RUN chmod a+x files/solve
RUN chmod a+x files/mutgen

USER galileo

ENTRYPOINT ./sim.sh

however I’ve been trying to run it again and every time I get permissions denied

/bin/sh: 1: ./sim.sh: Permission denied

I already try to use chown too and I wasn’t even able to run it as root. Is there something I am missing?

Hey @diego.rad, thanks for reaching out here. I’m going to try to get you up and going again asap.

If you could, please invite to your Mission our admin account (galileo@hypernetlabs.io). You can do this by going to the “User Management” tab and hitting the + button.

Search for galileo@hypernetlabs.io and and invite the account as an Admin. You will be able remove the account from your mission at any time by deleting it as a team member.

Hey @diego.rad, try changing the last line of your Dockerfile to the following:

ENTRYPOINT ["bash","sim.sh"]

Thanks to both, this worked!

I was also having problems giving permissions to “solve” and “mutgen” which are executables files from C. Moving the chmod commands for these into the bash script did the trick.

This is the dockerfile I ended up with for any future references

FROM ubuntu:20.04

RUN useradd -ms /bin/sh galileo

USER galileo
WORKDIR /home/galileo

COPY . .

ENTRYPOINT ["bash","sim.sh"]
1 Like

One more thing @diego.rad, the COPY . . command isn’t actually needed anymore. The Galileo LZ will automatically place your input files into WORKDIR for you. So you could try removing that line to speed up the build a little bit and also makes your Dockerfile even simpler.

Nice, I’ll do it, thanks!