Docker Cron Image
Go to file
2023-04-07 13:31:17 +02:00
build.sh added docker cron image build environment 2023-04-07 13:31:17 +02:00
crontab added docker cron image build environment 2023-04-07 13:31:17 +02:00
docker-entrypoint.sh added docker cron image build environment 2023-04-07 13:31:17 +02:00
dockerfile added docker cron image build environment 2023-04-07 13:31:17 +02:00
LICENSE first commit 2023-04-07 13:31:01 +02:00
README.md added docker cron image build environment 2023-04-07 13:31:17 +02:00
versions added docker cron image build environment 2023-04-07 13:31:17 +02:00

Docker Cron Image

A docker-based cron image to handle periodic jobs with ease, everything included

Usage:

docker run -v $CRONTAB:/crontab/root -v $CRONJOBS:/jobs bryanpedini/cron:$VERSION-$DISTRO

Example:

crontab:

* * * * * /jobs/echo.sh

jobs/echo.sh:

#!/usr/bin/env sh
echo "this is a custom cron job"

docker command:

docker run -it --rm -v $(pwd)/crontab:/crontab/root -v $(pwd)/jobs:/jobs bryanpedini/cron:1.0-alpine3.16

WARNING:

Pay attention to the crontab file permissions, ownership needs to be 0:0 for user root.