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