Docker ENTRYPOINT using docker run command Docker ENTRYPOINT using docker run command nginx nginx

Docker ENTRYPOINT using docker run command


You can add the ENTRYPOINT instruction at the end of your Dockerfile.

ENTRYPOINT ["/bin/bash","/root/service.sh"]

Of course, you'll need to add the service.sh to your image. Again using a Dockerfile

COPY service.sh /root/service.sh

In the end it will be something like this.

FROM docker-reg.sogeti-aws.nl:5000/ubuntu:v3COPY service.sh /root/service.shENTRYPOINT ["/bin/bash","/root/service.sh"]


To change the entry point to bash use the following command:

sudo docker run --entrypoint "/usr/bin/bash" -it <any-other-options> <img>

Note: don't add bash at the end, as we use to do when using -it.