GithubHelp home page GithubHelp logo

guoyu07 / docker-event-emitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deadleg/docker-event-emitter

0.0 0.0 0.0 54 KB

Push docker events to wherever

License: MIT License

Haskell 100.00%

docker-event-emitter's Introduction

Docker Event Emitter

Build Status

Subscribe to the /events Docker api and forward events to Redis or a RESTful endpoint.

On the container start event, container info from the /container/{id}/json api will be added to the event in the docker.event.emitter.container field. This is useful if you want to log container labels/ip addresses etc.

These is no guarantee that the events are emitted in the same order they are received, but in general order will be preserved. Container start events might be a bit delayed due to the call to /container/{id}/json.

Usage

Docker Event Emitter - relay docker events to somewhere else

Usage: openresty-docker-exe (-b|--backend BACKEND) (-e|--endpoint ENDPOINT)
  Emit docker events to a subscriber such as Redis or a RESTful endpoint.

Available options:
  -h,--help                Show this help text
  -b,--backend BACKEND     Backend type: redis | web
  -e,--endpoint ENDPOINT   Redis: hostname:port | web: full url

Note that there are no defaults, you must specify what backend you want to use and the endpoint for it.

Currently only redis and web endpoints are supported.

Can also be run with Docker

docker run -v /var/run/docker.sock:/var/run/docker.sock --name dee deadleg/docker-event-emitter -b redis -e redis:6379

Redis

For every event, the JSON for that event is published to the container:event channel using Redis's inbuilt pub/sub mechanism.

Web

For every event, the JSON is POSTed to the supplied endpoint.

Dockerfile

To create a Docker image, just run

docker build -t {your tag}  .

Then run with

docker run -v /var/run/docker.sock:/var/run/docker.sock --name dee {your tag} -b redis -e redis:6379

Development

Cloning and running stack build should build everything with no problem.

docker-event-emitter's People

Contributors

deadleg 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.