One of:
docker pull srittau/cron:latest-copy
docker pull srittau/cron:latest-onbuild
There are two variants of the image: onbuild and copy. The onbuild
requires several files in your build directory:
- A
crontabfile. A sample crontab is included. Python modules can be run using the/app/run-module.shscript. - A
msmtprcconfiguration file. If you don't want to send mail, this file can be empty. A sample file is included.
In your Dockerfile:
FROM srittau/cron:3.13-onbuild
The copy variant requires you to copy your Python modules into the image
yourself. In your Dockerfile:
FROM srittau/cron:3.13-copy
COPY ./crontab /etc/crontab
COPY ./msmtprc /app/msmtprc
Copying the .msmtprc file is optional. By default, the image will not send mail.
Your Python modules should be copied into the /app/src directory in your
image. You can also copy or mount a environment file to /app/env. Shell
variables in this file are added to the environment before running your
scripts.