How to build a cron docker image properly?
The only difference between using COPY
and RUN
are the permissions on the /etc/crontab
file: with COPY
this is 664 and with RUN
644.
I cannot find anything on permissions that /etc/crontab
needs to have but if you add
RUN chmod 644 /etc/crontab
after the COPY
line in your Dockerfile
the cronjobs run (at least for me).
So I think the permissions have to be 644