Giter Club home page Giter Club logo

des's Introduction

Docker Event Scripts

Run scripts in response to Docker events.

https://circleci.com/gh/colebrumley/des.svg?style=svg

Version: 0.1.3 Author: Cole Brumley

Overview

Use the des command to monitor Docker for events. When an event occurs, des executes a script with the event metadata exported to the environment.

Installation / Usage

To install use pip:

pip install docker-event-scripts

The script directory is defined via the -d flag, and defaults to /etc/docker/events.d. Scripts should be placed in sub-directories in the format SCRIPT_DIR/EVENT_TYPE/EVENT and should be marked executable.

The environment variables set during each script run are a flattened version of the raw API event dictionary. If you're writing a script for an event you're unfamiliar with, you may want to run it once with printenv to see what's available.

See the Docker docs for the full list of possible events.

To generate a full directory structure with dummy scripts for every event, run des -c.

Contributing

Please submit issues or pull requests via the GitHub repo.

Example

Using the default script directory, when this example container was started using docker run -it --rm alpine sh, the script at /etc/docker/events.d/container/start was executed with the following environment:

ACTION=start ACTOR_ATTRIBUTES_IMAGE=alpine TIME=1471131434 ACTOR_ID=467730e17a0ac265eae034d21cf633755aa57d03483ae479b623bc5569d6c274 STATUS=start ACTOR_ATTRIBUTES_NAME=backstabbing_lichterman ID=467730e17a0ac265eae034d21cf633755aa57d03483ae479b623bc5569d6c274 FROM=alpine TYPE=container TIMENANO=1471131434853322607

des's People

Contributors

colebrumley avatar

Watchers

James Cloos avatar Cornelius Buschka avatar  avatar

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.