I am trying to build a Debian-based image to dockerize a cron process, but my cron jobs are never started.
Here is my
FROM debian:jessie RUN apt-get update && apt-get install -y --no-install-recommends cron COPY jobs.txt /etc/crontab RUN touch /log.txt CMD ["cron", "-f"]
* * * * * root echo "job done" >> /log.txt
I realized that there is something wrong with the
COPY command, because when I replace
COPY jobs.txt /etc/crontab
RUN echo '* * * * * root echo "job done" >> /log.txt' > /etc/crontab
it works perfectly.
So is there a problem just with
jobs.txt file and Docker unable to copy it the right way? Should I only fix that file, or use a completely different approach?