PROVIDER - Docker Job Scheduler

Ofelia

Ofelia is a scheduler that runs inside a container and triggers Docker jobs on cron rules, starting one-off containers or executing commands in running ones; MIT licensed and small to deploy.

Automation Spain 2026.11.30 0 views
3.6pts
Advertisement

Service Overview

Ofelia is a task scheduler built for containers: it runs in its own container, triggers other Docker jobs on cron rules, and can start throwaway containers, execute commands inside running ones, or restart service containers. It moves backups, cleanups and syncs under the same orchestration as the applications they serve.

The project is MIT licensed at 0.3.23, written in Go with a small image. Configuration lives either in a dedicated file or directly in docker-compose.yml service labels, versioned alongside the stack.

Key Strengths

  • One scheduler container replaces host crontabs without installing anything on the host.
  • Both throwaway containers and exec into running containers are supported per job.
  • Job definitions can live in compose labels, keeping tasks next to their services.
  • Cron expressions and shorthands such as every interval cover common schedules.
  • MIT licensing brings no fee or task cap, and the image is light on resources.

Limitations

  • Docker and compose knowledge is required, and label syntax takes an initial read.
  • There is no UI, so job state is visible only through container logs, without history views.
  • The scheduler is a single container, and jobs due during a restart are skipped.
  • Complex dependencies and retries belong in the job scripts, not the scheduler.
  • The community is small, and help comes mostly from the repository issues and docs.

Product Ecosystem

The scheduler fires on cron: a new container or a command inside one Ofelia container reads config and schedules job-run starts a one-off container job-exec runs inside a running container Config sources: a dedicated file, or docker-compose service labels Timing: cron expressions and shorthands such as daily or every interval
Figure 1: Scheduler container and two execution modes (scope: repository documentation, 2026-11)

Ofelia leaves business logic to the jobs and only decides when to fire. Two modes dominate: a new container that runs and exits, and a command executed inside a long-running container that already has the right environment.

Config sources and labels

Configuration is either a dedicated file or labels on compose services. Labels keep job definitions in the same file as the application, so a deploy carries the schedule with it.

Job types

job-run starts a container for one execution, job-exec runs inside a running one, job-local runs in the scheduler itself, and service jobs restart a target container for rolling updates.

Timing and logs

Jobs accept standard cron expressions and shorthands, with output going to container logs readable through docker logs. Failures do not retry automatically, so scripts own retries and alerts.

Fitting into site operations

Typical jobs back up databases, clean temporary files and warm caches. When a backup must notify another system, verify the callback per webhook signature verification.

Use Cases

  • Good fit|Scheduled backups on one host: run backup scripts in containers instead of host cron.
  • Good fit|Compose-deployed site operations: jobs and apps share one compose file.
  • Good fit|Batch work reusing a runtime: exec inside an existing container instead of rebuilding images.
  • Good fit|Small hosts with tight resources: a light image fits constrained machines.
  • Evaluate|Teams needing UI and audit: state lives in logs only.
  • Evaluate|Complex dependency and retry flows: orchestration features are limited.
  • Evaluate|Large multi-host scheduling: the single-scheduler model does not scale far.

Open Source License & Deployment Cost

Free software; cost is host resources and maintenance time Licence MIT, free for commercial use no task cap Host scheduler plus job containers memory sized by concurrency Operations log reading and triage retries and alerts live in scripts Set a restart policy on the scheduler container so restarts do not drop later jobs (scope: repository licence and documentation, 2026-11)
Figure 2: Deployment cost structure (scope: repository licence and documentation, 2026-11)

The tool is free, with investment in host resources and maintaining the job scripts.

Item Billing Size and volume Notes
Licence free unlimited tasks MIT, commercial use allowed, notices kept
Host resources per cloud or self-hosted scheduler plus job containers memory sized by concurrent jobs
Image registry per chosen service job image storage and pulls private images need credentials
Operations effort internal team time log reading, script upkeep, triage retries and alerts belong in scripts
Monitoring usually reuses existing stacks container logs and exit codes watch failures and missed runs

FAQ

  • How is this different from system cron? Host cron runs on the machine with logs and dependencies on that host; Ofelia runs in a container and executes jobs as containers, so dependencies live in images and config is versioned with the stack. The trade-off is that the host must provide Docker and Socket access.
  • Do failed jobs retry? No, Ofelia only triggers on schedule. Retries, backoff and alerts belong in the job scripts, for example retry loops or a notification call on failure; otherwise failures surface only in logs and non-zero exit codes.
  • How do I know a job really ran? Read the scheduler and job container logs through docker logs and check start times, finish times and exit codes. Pair important jobs with heartbeat monitoring so a success ping goes out and silence raises an alert.
  • Are jobs missed during restarts? Jobs due while the scheduler restarts are skipped and not backfilled. Set a restart policy on the scheduler, add reporting and backfill logic to critical scripts, or move critical chains to a scheduler that supports backfills.

Integration & Code Examples

Define jobs in compose labels

services:
  scheduler:
    image: mcuadros/ofelia:latest
    depends_on: [db]
    command: daemon --docker
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      ofelia.job-run.backup.schedule: "0 2 * * *"
      ofelia.job-run.backup.container: "backup-runner"
      ofelia.job-exec.cleanup.schedule: "@daily"
      ofelia.job-exec.cleanup.container: "app"
      ofelia.job-exec.cleanup.command: "php artisan cache:clear"

--docker reads jobs from labels; mount the Docker socket read-only and treat that access as a security boundary of its own.

Community & Resources

Visit Ofelia Website → https://github.com/mcuadros/ofelia
Visit Website ↗