Docker Community Forums

Share and learn in the Docker community.

Cron in Alpine Docker
echo “Job started: $(date)”

Add additional instructions

echo “Job finished: $(date)”


FROM python:3.7-alpine
COPY /etc/periodic/15min/test
RUN chmod 755 /etc/periodic/15min/test
CMD [ “crond”, “-l”, “2”, “-f” ]

Build went fine, cronscript file get created, but when i run the container get this error
“run-parts: can’t execute ‘/etc/periodic/15min/test’: No such file or directory”

really strange. Even though file is there with right permission, cron triggers but cant see the file. No files in /var/log

What i am trying to do successfully running a cron.


ok found the issue. I am running Docker desktop on Windows. so i had to add one more line in the Dockerfile

RUN dos2unix /etc/periodic/15min/test