Docker DockerCron Image
Go to file
2023-04-07 13:32:46 +02:00
build.sh added docker dockercron image build environment 2023-04-07 13:32:46 +02:00
crontab added docker dockercron image build environment 2023-04-07 13:32:46 +02:00
docker-entrypoint.sh added docker dockercron image build environment 2023-04-07 13:32:46 +02:00
dockerfile added docker dockercron image build environment 2023-04-07 13:32:46 +02:00
LICENSE first commit 2023-04-07 13:31:56 +02:00
README.md added docker dockercron image build environment 2023-04-07 13:32:46 +02:00
versions added docker dockercron image build environment 2023-04-07 13:32:46 +02:00

Docker DockerCron Image

A docker-based cron image that includes the docker & docker compose CLI.

Usage:

docker run -v $DOCKERSOCKET:/var/run/docker.sock -v $CRONTAB:/crontab/root -v $CRONJOBS:/jobs bryanpedini/dockercron:$VERSION-$DISTRO

Example:

crontab:

* * * * * /jobs/dockerps.sh

jobs/dockerps.sh:

#!/usr/bin/env sh
docker ps -a

docker command:

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

WARNING:

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