Skip to content

Installation with Docker

About

swarm-cronjob provides automatically updated Docker 🐳 images within several registries:

Registry Image
Docker Hub crazymax/swarm-cronjob
GitHub Container Registry ghcr.io/crazy-max/swarm-cronjob

It is possible to always use the latest stable tag or to use another service that handles updating Docker images.

Note

Want to be notified of new releases? Check out 🔔 Diun (Docker Image Update Notifier) project!

Following platforms for this image are available:

$ docker run --rm mplatform/mquery crazymax/swarm-cronjob:latest
Image: crazymax/swarm-cronjob:latest
 * Manifest List: Yes
 * Supported platforms:
   - linux/amd64
   - linux/arm/v6
   - linux/arm/v7
   - linux/arm64
   - linux/386
   - linux/ppc64le

Usage

version: "3.2"

services:
  swarm-cronjob:
    image: crazymax/swarm-cronjob
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - "TZ=Europe/Paris"
      - "LOG_LEVEL=info"
      - "LOG_JSON=false"
    deploy:
      placement:
        constraints:
          - node.role == manager

Edit this example with your preferences and deploy the stack:

docker stack deploy -c swarm_cronjob.yml swarm_cronjob

Or use the following command:

docker service create --name swarm_cronjob \
  --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
  --env "LOG_LEVEL=info" \
  --env "LOG_JSON=false" \
  --constraint "node.role == manager" \
  crazymax/swarm-cronjob

You are now ready to deploy cronjob based services with swarm.


Last update: 2021-09-05 14:56:01
Created: 2020-09-21 23:07:39