Giter VIP home page Giter VIP logo

dockron's Introduction

๐Ÿณ Dockron

Simple task scheduling for Docker jobs

๐Ÿš€ Features

  • Cron Syntax. Powerful, explicit scheduling.
  • Logging. Comprehensive logging built-in.
  • Simple. Easy to install, configure, and deploy.

๐Ÿ”จ Installation

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

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']

๐Ÿณ Running with Docker

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

๐Ÿ“’ Configuration

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"

๐Ÿš— Roadmap

  • 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)

dockron's People

Contributors

andrewsosa avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

dockron's Issues

Support network option

Currently, the Docker container launches on the default network. Would be useful to be able to attach to a specified network

Log container exit w/ exit code

Dockron shows a message for container start, but not for container close. It would be helpful to log the container close event, as well as print the exit code when doing so.

Add environment variable interpolation to config file

Might look like this:

["My Task"]
schedule = "* * * * *"
image = "alpine"
command = "ping ${HOST}"
network = "${COMPOSE_PROJECT_NAME}_default"

Two criteria:

  • load variables from actual environment (process.env) [v0.2.0]
  • load variables from .env file (a la dotenv)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.