Sorry, but I guess you haven’t understood the question.
This is not about the docker itself. I am referring to the services running inside the docker. When I stop the container and start it again, I have to manually start the services within the container (mysql and apache) by logging into the docker.
Oh, i see. I never would have imagined that the discussion is about finding a workaround for an image that is not designed according the docker way of “one service per container”. I am not going to tell you how to ride a dead horse
Though, I would strongy advice to replace your self made image with a set of official docker images from Dockerhub and learn how to wire them together with docker-compose.
If you realy want to use docker I would strongly suggest to adopt the underliying patterns. Ignoring them and trying to apply patterns from the vm world brought you to this point.
If you are not willing to adopt, you will be better off in shipping a vm. If you don’t want to loose the infructure as code approach -> you can use HashiCorp Packer to script the creation of VMs.
The minimum VM size is 5GB and with docker we are doing 332 MB only for our application. Docker is definitely more portable! We’ll stick to it
I appreciate that you have been answering, but you have proposed more on changing the design altogether which is not needed.
We had just asked to for the services within the docker container to be automatically started on start/restart, pretty much like on system boot (init scripts) or something similar. Strange to see that there has been no solution on it !