Skip to content

Latest commit

 

History

History
39 lines (35 loc) · 1.48 KB

README.md

File metadata and controls

39 lines (35 loc) · 1.48 KB

Docker CRON Daemon container

stars pulls build status
Dockerfile for creating image with cron deamon on alpine linux. This image enables the end user to add additional packages on container start.

Usage

docker run \
-d \
--name crond \
-e 'ADD_PACKAGES=<additional packages>' \
-e 'CRON_STRINGS=* * * * * root /scripts/my-script.sh' \
-v /path/to/custom/scripts:/scripts \
-v /path/to/custom/crontab:/etc/cron.d \
maschel/crond

Parameters

  • ADD_PACKAGES (optional): space seperated list of (APK) packages to install before the container is started (mind the '').
  • CRON_STRINGS (optional): list of cronjobs to be added to crond. use \n for newline. (mind the '').

Volumes

  • /scripts Location for storing custom scripts which can be run via cronjobs.
  • /etc/cron.d Add multiple cron files.

Docker compose

version: "3"

services:
  crond:
    container_name: crond
    image: maschel/crond
    restart: unless-stopped
    environment:
      - 'ADD-PACKAGES="<additional packages>'
      - 'CRON-STRINGS='* * * * * root /scripts/my-script.sh'
    volumes:
      - /path/to/custom/scripts:/scripts
      - /path/to/custom/crontab:/etc/cron.d

License

MIT LICENSE - Copyright (c) 2018 Geoffrey Mastenbroek