I am trying to run cron jobs on an alpine-based image (node:18.6.0-alpine3.15 to be exact).
The relevant lines of my Dockerfile are as follows:
FROM node:18.6.0-alpine3.15
RUN apk add--update busybox-suid
COPY ./config/crontab.txt /etc/crontabs/root
When I run this image, cron does not automatically start. If I run crond restart
as root in the container, however, it starts running as expected.
I would like to automatically start the cron daemon on startup of the container. What is the recommended way of doing so?
I googled around a bit and found this:
https://wiki.alpinelinux.org/wiki/Alpine_Linux:FAQ#Why_don't_my_cron_jobs_run?
However, this did not solve my issue and cron still did not start up automatically.