Sign inSign up

maschel/crond

By maschel

•Updated over 8 years ago

Dockerfile for creating image with cron deamon on alpine linux

Image
0

140

maschel/crond repository overview

⁠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

Tag summary

Content type

Image

Digest

Size

2 MB

Last updated

over 8 years ago

docker pull maschel/crond