Im very new to docker, however I’ve dived into it, I created my first python app.
I managed to create an image and then a run a container, however I’ve been wrestling to get nginx started automatically. So far I tried these, but none of those starts nginx at boot time:
Last CMD declartion wins. You will need to write an entypoint script and script your desired start process inhere. You have plenty of examples, If you browse Dockerhub descriptions - usualy they have a github link. Checkout their Dockerfile to see how they copy the entrypoint script into the container and declare it in CMD. Then check the entrypoint script to see how they do things.
A container is not “booting”. When a container starts, it will start the command defined in ENTRYPOINT (if the declaration exists) or CMD (if ENTRYPOINT is not defined). Those commands are usualy scripts - so called entrypoint scripts - that take care of preparation work, like render env variables into config files or start a service your main service depends on, and starts the main service.