Docker Cron Image
build.sh | ||
crontab | ||
docker-entrypoint.sh | ||
dockerfile | ||
LICENSE | ||
README.md | ||
versions |
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
.