Skip to content

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

License

Notifications You must be signed in to change notification settings

maschel/docker-crond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages