How to run a cron job inside a docker container

前端 未结 4 879
野性不改
野性不改 2020-12-07 14:21

I tried to run a cron job inside a docker container but nothing works for me.
My container has only cron.daily and cron.weekly files.
<

4条回答
  •  隐瞒了意图╮
    2020-12-07 14:43

    crond works well with tiny on Alpine

    RUN apk add --no-cache tini
    
    ENTRYPOINT ["/sbin/tini", "--"]
    CMD ["/usr/sbin/crond", "-f"]
    

    but should not be run as container main process (PID 1) because of zombie reaping problem and issues with signal handling. See this Docker PR and this blog post for details.

提交回复
热议问题