Sign inSign up

softwarecraftsmen/cron

By softwarecraftsmen

•Updated over 8 years ago

A cron scheduler

Image
0

595

softwarecraftsmen/cron repository overview

⁠README

This implementation is based on cron

⁠Prepare a docker host

docker-machine create --driver virtualbox default <1>
docker-machine start default <2>
eval `docker-machine env default` <3>
  1. Create a docker machine (once only)
  2. Start the docker machine
  3. Setup the docker client to use the docker-machine

⁠Build cron

docker build -t softwarecraftsmen/cron .

⁠Extend and run cron

The cron base container only provides the scaffolding for cron jobs. In order to implement a cron job it must be extended and a job schedule has to be added.

The demo folder is containing a sample Dockerfile and docker-compose script to demonstrate the use of the base image.

FROM softwarecraftsmen/cron
MAINTAINER Software Craftsmen GmbH und CoKG <[email protected]>
ADD cron-setup.sh cron-setup.sh
RUN chmod +x cron-setup.sh

cron-setup.sh

#!/usr/bin/env bash
echo  "* * * * * root echo hello >> $CRON_LOG 2>&1" >> /etc/cron.d/docker-cron
chmod 0644 /etc/cron.d/docker-cron

To fire up the cron scheduler run the docker-compose script.

docker-compose --project-name=docker-cron-demo up 

Tag summary

Content type

Image

Digest

Size

39 MB

Last updated

over 8 years ago

docker pull softwarecraftsmen/cron:1.0.2