|IamTheFij b5a19bb1d2 Add drone builds||6 months ago|
|.drone.yml||2 months ago|
|.gitignore||6 months ago|
|Dockerfile||6 months ago|
|Gopkg.lock||6 months ago|
|Gopkg.toml||6 months ago|
|LICENSE||6 months ago|
|Makefile||6 months ago|
|README.md||3 months ago|
|main.go||6 months ago|
Simple scheduling for short-running Docker containers
Dockron requires access to the Docker, so it may need to be run as root, or, if in a Docker container, need the socket mapped as a volume.
As simple as:
It will then run in the foreground, periodically checking Docker for containers with labels containing a cron schedule.
By default, Dockron will periodically poll Docker for new containers or schedule changes every minute. You can specify an interval by using the
First, be sure your container is something that is not long running and will actually exit when complete. This is for batch runs and not keeping a service running. Docker should be able to do that on it’s own with a restart policy.
Create your container and add a label in the form
dockron.schedule="* * * * *", where the value is a valid cron expression (See the section Cron Expression Formatting).
Dockron will now start that container peridically on the schedule.
For more information on the cron expression parsing, see the docs for robfig/cron.
Dockron is quite simple right now. It does not yet:
I intend to keep it simple as well. It will likely never:
Either use a separate tool in conjunction with Dockron, or use a more robust scheduler like Tron, or Chronos.