Simple task scheduling for Docker jobs
- Cron Syntax. Powerful, explicit scheduling.
- Logging. Comprehensive logging built-in.
- Simple. Easy to install, configure, and deploy.
You can install and run dockron
using either locally with npm:
npm i -g dockron
Or by running in Docker (recommended):
docker pull andrewsosa/dockron
Usage: dockron [options]
Options:
-h --help Show this.
-v --validate Validate config file only.
-c --config=<config> Choose config file [default: /etc/dockron/dockron.toml]
-s --socket=<socket> Choose Docker socket [default: /var/run/docker.sock]
-d --debug Print the argument object (for debugging).
-l --level Set logging level [default: 'info']
If running inside a Docker container, you will need to mount both a configuration file and the Docker socket.
docker run -v /var/run/docker.sock:/var/run/docker.sock \
-v ./path/to/dockron.toml:/etc/dockron/dockron.toml \
andrewsosa/dockron
Alternatively, you can build your own image to add the config:
FROM andrewsosa/dockron
COPY ./path/to/dockron.toml /etc/dockron/dockron.toml
dockron
expects a configuration at /etc/dockron/dockron.toml
, but you can change that with --config
.
["Sample Task Name"]
schedule = "* * * * *"
image = "alpine"
command = "sleep 10"
["Hourly Task"]
schedule = "0 * * * *"
image = "ubuntu"
command = "echo 'Hello, world\!'"
network = "my_network"
- Choosing a container name in dockron.toml
- Allowing multiple networks in dockron.toml
- Add environment variable interpolation (v0.2.0)
- Add Docker event streaming (e.g. container exit)