How to run a cron job inside a docker container?

前端 未结 20 1314
無奈伤痛
無奈伤痛 2020-11-22 05:36

I am trying to run a cronjob inside a docker container that invokes a shell script.

Yesterday I have been searching all over the web and stack overflow, but I could

20条回答
  •  旧时难觅i
    2020-11-22 06:15

    When you deploy your container on another host, just note that it won't start any processes automatically. You need to make sure that 'cron' service is running inside your container. In our case, I am using Supervisord with other services to start cron service.

    [program:misc]
    command=/etc/init.d/cron restart
    user=root
    autostart=true
    autorestart=true
    stderr_logfile=/var/log/misc-cron.err.log
    stdout_logfile=/var/log/misc-cron.out.log
    priority=998
    

提交回复
热议问题