Suppose we have to run a script every 15 mins with tools that already exist in our app container (e.g. php, node, etc.) What is the best way to do this?
For example:
- Run cron within the app container
- Run cron as a separate container
- Run cron on the host (using docker exec)
UPDATES
Most of the answers to this question seem to only address SYSTEM crons
which are installed either in /etc/cron.d/
or /etc/crontab
on the Ubuntu 16.04 base image however I'm more interested in USER crons which normally reside in /var/spool/cron/crontabs
for ALL users crons
or I believe in /home/user/crontab(not too sure)
I am running my container as a non-root user
and need to be able to do RUN crontab myCrontab
and have myCrontab
under that non-root user within my container
and NOT the usual system path listed earlier above.
Hope that's clearer and not identified as a duplicate of the other popular question.
Any ideas ?