I have a custom package with install.sh
script, which I want to run while building a docker image (meaning - put ./install.sh
inside Dockerfile). I could have ran it along with the container, but I want to have an image that contains the required packages (which are mentioned in the install
script).
What I tried:
RUN /bin/sh/ -c "./install.sh"
RUN ./install.sh
It errors out saying -
/bin/sh install.sh not found
or
/bin/sh ./install.sh not found
This might be a repeated question, but I haven't found an answer to this anywhere. Any help would be appreciated.
You must copy your install.sh
into docker image with this command in your dockerfile:
COPY install.sh /tmp
Then use your RUN
command to run it:
RUN /bin/sh -c "/tmp/install.sh"
or
RUN sh /tmp/install.sh
Don't forget to make install.sh
executable before run it:
chmod +x /tmp/install.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With