Skip to content

dkruger/docker-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

docker-cron

This is a simple Docker container which executes cron jobs.

If you need help writing the cron entry, checkout crontab.guru.

Using the image

This image really isn't as useful on its own, but is better used as a base for job-specific iamges.

For very simple cron jobs simply specify the CRONTAB_ENTRY environment variable. This is plugged directly into root's crontab spool.

docker run \
    --name some-cron \
    -e CRONTAB_ENTRY="* * * * * touch /some_file"
    dkruger/cron

More likely you'll need to modify the docker image to add additional utilities and/or tweak the crontab entry based on other environment variables. To help with that there is a entrypoint hook directory /entrypoint.d which you can place your own entrypoint files into. They will be sourced by the main ENTRYPOINT before the crontab is written. For an example, checkout dkruger/mysql-backup.

About

A very simple Docker container for executing cron jobs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages