Docker: Cronjob is not working

后端 未结 2 911
小蘑菇
小蘑菇 2020-12-21 10:59

I am trying to run cron job on Docker container. I have a running container (Fedora 20). I have also installed cron packages in container and explicitly run the cron daemon

2条回答
  •  我在风中等你
    2020-12-21 11:18

    You can do:

    ENTRYPOINT cron -f

    although remember that you can only have one ENTRYPOINT.

    From the docs:

    There can only be one ENTRYPOINT in a Dockerfile. If you have more than one ENTRYPOINT, then only the last one in the Dockerfile will have an effect.

    An ENTRYPOINT helps you to configure a container that you can run as an executable. That is, when you specify an ENTRYPOINT, then the whole container runs as if it was just that executable.

提交回复
热议问题