Sign inSign up

homecentr/cron-base

By homecentr

•Updated about 5 years ago

Image
0

4.8K

homecentr/cron-base repository overview

Project status

CI/CD on master

⁠HomeCentr - cron-base

This docker image is used as base image for all homecentr images which require a cron scheduler but can also be used on its own. The image executes a mounted script at the specified schedule and reports the results into a Prometheus push-gateway⁠ for easy monitoring and alerting.

⁠Usage

version: "3.7"
services:
  cron-base:
    build: .
    image: homecentr/cron-base
    restart: unless-stopped
    environment:
      CRON_SCHEDULE: "* * * * *" # Run script every minute
      PUSH_GATEWAY_URL: "http://push_gateway:9091/metrics/job/cron/label-name/label-value"
    volumes:
      - ./example/success:/cron # must contain cron-tick script

⁠Environment variables

NameDefault valueDescription
PUID7077UID of the user the cron-tick script should be running as.
PGID7077GID of the group the cron-tick script should be running as.
CRON_SCHEDULECron expression⁠ which defines when/how often the script will be executed. This variable is mandatory.
PUSH_GATEWAY_URLURL of the push gateway⁠ job where the metrics should be reported. The reporting is skipped if the variable is not set.

⁠Exposed ports

The image does not expose any ports.

⁠Volumes

Container pathDescription
/cronDirectory containing the script which should be executed, the script must be named cron-tick.

⁠Security

The container is regularly scanned for vulnerabilities and updated. Further info can be found in the Security tab⁠.

⁠Container user

The container supports privilege drop. Even though the container starts as root, it will use the permissions only to perform the initial set up. The cron-tick script is executed as UID/GID provided in the PUID and PGID environment variables.

:warning: Do not change the container user directly using the user Docker compose property or using the --user argument. This would break the privilege drop logic.

Tag summary

Content type

Image

Digest

Size

10.7 MB

Last updated

about 5 years ago

docker pull homecentr/cron-base