Sign inSign up

pdbs/docker-swarm-cron

By pdbs

Updated almost 2 years ago

Docker Swarm Cron Executes cron jobs in a swarm environment

Image
0

5.8K

pdbs/docker-swarm-cron repository overview

docker-swarm-cron

Docker Swarm Cron Executes cron jobs in a swarm environment on every node running a specific container.

Compose File

version: '3.7'

services:
   cron:
    image: pdbs/docker-swarm-cron
    volumes:
        - $basedir/crontab:/etc/crontab
        - /var/run/docker.sock:/var/run/docker.sock
        - /etc/timezone:/etc/timezone:ro
        - /etc/localtime:/etc/localtime:ro
    deploy:
        mode: global

crontab

Tasks are executed from file crontab. To execute a command with parameters in service 'servicename' every hour on a docker swarm node use the following syntax:

0 * * * *    docker-swarm-exec <servicename> <command> <parameters>

The file $basedir/crontab must be accessible on every swarm node. Changes in this file are loaded on service start or by issuing the command 'crontab /etc/crontab' in every instance of the service.

Tag summary

Content type

Image

Digest

sha256:3ea9baa2d

Size

141.4 MB

Last updated

almost 2 years ago

docker pull pdbs/docker-swarm-cron