Sign inSign up

djpic/cron

By djpic

Updated 4 days ago

Cron Service built on Alpine

Image
Developer tools
2

10K+

djpic/cron repository overview

Alpine Cron

Use Case

I needed a basic cron container using wget to run scheduled php scripts. I looked at jobber but decided to build my own with Alpine. The image is smaller than Jobber at 5.61MB and uses the standard crontab files.

Default Cron Options
  • Logging is set to 8 and outputted to docker.
  • Additional 1 minute schedule added
  • Additional 30 minute schedule added
  • Additional 12 hour schedule added

Place scripts in the following directories (make sure permissions are set to execute):

Every minute
/etc/periodic/1min/
Every 15 minutes (at x:00, x:15, x:30, x:45)
/etc/periodic/15min/
Every 30 minutes (at x:00 and x:30)
/etc/periodic/30min/
Hourly (at x:00)
/etc/periodic/hourly/
Every 12 hours (at 12am and 12pm)
/etc/periodic/12hour/
Daily (at 2:00 am)
/etc/periodic/daily/
Weekly (Sunday at 3:00 am)
/etc/periodic/weekly/
Monthly (1st of every month at 5:00am)
/etc/periodic/monthly/
Versions
standard / latest
Standard it just that, the standard version. Jobs will run based on the intervals and directories stated in the how to use the image section above. FastCGI is installed in this version for any PHP scripts that need to run.
default
The default variant is built from the standard variant but already includes a script which runs every minute. This script uses FastCGI to execute a PHP file located at /app/private/scheduled_jobs/1min.php on the PHP-PFM container

For more information on this image and how to use this image, visit my article: Docker Image: Alpine Cron

For the source files used to build this image, visit my GitLab.

Get notified when my docker images are updated and when new articles are posted to my website by following my twitter @djpic_llc

For any questions please contact me at www.djpic.net

Tag summary

Content type

Image

Digest

sha256:33e3a12b1

Size

6.6 MB

Last updated

4 days ago

docker pull djpic/cron