Sign inSign up

blue271828/crond

By blue271828

Updated almost 7 years ago

Lightweight crond Docker image

Image
0

416

blue271828/crond repository overview

Cron daemon Docker image

Docker Cloud Build Status

This image contains a crond. You can set jobs via environment variables.

Usage

This project provides container images on Docker Hub .

$ docker pull blue271828/crond
Environment variables

When you launch the image, you can configure some options.

VariableDefaultDescription
TZUTCChange the time zone in the container.
Refer to List of tz database time zones If you set an arbitrary time zone.
LOG_LEVEL8Set log level for crond.
This corresponds to crond -l option.
LOG_FILE-Set a log file for crond.
This corresponds to crond -L option.
CRONTAB-Set crontab settings.
If you set this variable. User's crontab file is overwritten on launch.
CRONTAB_FILE-Set crontab settings by file.
This file is ignored if you set CRONTAB env.
Example

A container will output “hello crond!” every minute when you type the following command.

$ docker run -it -e CRONTAB='* * * * * echo "hello crond!"' blue271828/crond

If you want to run with Docker Compose, the compose file looks like below.

version: '3'
services:
  crond:
    image: blue271828/crond
    environment:
      TZ: Asia/Tokyo
      LOG_LEVEL: 1
      LOG_FILE: /var/log/crond/crond.log
      CRONTAB: |
        * * * * * echo "hello crond!"
        * * * * * date
    volumes:
      - ./crond:/var/log/crond

Testing

You can test manually with the below command. This project is using dgoss (dgoss is docker wrapper around Goss) for testing. Before deploying a new docker image to Docker Hub, Automated builds kicks this testing script.

$ docker-compose -f docker-compose.test.yml run sut

Tag summary

Content type

Image

Digest

Size

16.8 MB

Last updated

almost 7 years ago

docker pull blue271828/crond