I am new to the docker world. I have to invoke a shell script that takes command line arguments through a docker container.
Ex: My shell script looks like:
COPY ./file.sh /
CMD /bin/bash file.sh
@user1801934, are you sure @Gilles Quenot's answer is correct?
put the arg1 into Dockerfile directly, is that your request?
Here is my answer.
#!/usr/bin/env bash echo $1
using the exist Dockerfile
Build the image:
docker build -t test .
run the image with argument
xyz or something else.
docker run -ti test /file.sh abc docker run -ti test /file.sh xyz