CRON container programmable via environment variables
1.2K
This cron container receives jobs via the environment variables and scrips to be run can be mounted via volumes. Output is logged to the console
To run any of the examples below, clone this repository locally and build a sample image:
$> git clone https://github.com/cristiroma/docker.cron.git
$> cd docker.cron
$> sudo su
#> docker build -t cronimage .
docker run --rm -e "CRON_JOB_ECHO=* * * * * root echo 'Waking up ...' >> /var/log/cron.log 2>&1" --name sisyphus_container cronimage
After a couple of minutes, the console should look like this:
Installing job: CRON_JOB_ECHO in /etc/cron.d/CRON_JOB_ECHO
1 CRON jobs installed ...
Waking up ...
Waking up ...
Waking up ...
Waking up ...
Content type
Image
Digest
Size
38.6 MB
Last updated
over 8 years ago
docker pull eaudeweb/cron