Docker Community Forums

Share and learn in the Docker community.

Running a Command When a Docker Container Starts


(Amithaprabath) #1

Hi,

I want to run a command when a docker container starts. I am creating a mirth software container and I want to run " /pathto-mirth-folder/mcserver start" command. How can I achieve this while creating a docker file?

I want to know another thing. Can cron jobs be run inside a docker container? I tried @reboot option in a container to run the above command when the docker container stops and start again, but it seems that it is not working( I have committed the container as well).

Thanks.