I am creating a Docker image. I have 'install.sh' script file and want to run this script file in Dockerfile.
How should i do this ?
Step 1: Create a script.sh file and copy the following contents. Step 2: You should have the script.sh is the same folder where you have the Dockerfile. Create the Dockerfile with the following contents which copy the script to the container and runs it part of the ENTRYPOINT using the arguments from CMD.
To exit out of the docker container bash shell. Just run exit or hit ctrl-D like you normally would.
Steps as follows :
Copy '.sh' file to container
COPY install.sh .
Executing '.sh' file
RUN ./install.sh
'install.sh' file should be in current working directory else you can specify path.
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