So I followed the guide to add an entryscript into the Dockerfile
ADD shell.sh /home/shell.sh
RUN chmod +x /home/shell.sh
EXPOSE 80/tcp 443/tcp
And because I don’t want the container to exit instantly, I added a /bin/bash to hold the container.
Now here’s something which I don’t understand happens:
After the container runs, it will go into the bash.
You can type exit once, and exit once to another layer of bash, will be able to reattach, but if you type exit again, the other layer of bash exits and container stops.
However, if I remove the /bin/bash and run container, it exits instantly after the entrypoint is done.
So it’s either bash inside bash or 1 bash but exits instantly(the interface will show, but instantly exits).
My starting arguments:
( equivalent to -dit some post suggests )