Sign inSign up

oguya/docker-event-notifier

By oguya

•Updated over 9 years ago

A slack-bot that sends docker events to a slack channel

Image
0

1.1K

oguya/docker-event-notifier repository overview

⁠Docker Events Notifier

Receive Slack notifications when a container dies

⁠How it works

This image connects to the host machine socket, through a volume mapping, and listen Docker Events API⁠.

When a die event is triggered it sends the affected container's information to the selected Slack channel.

⁠Build

docker build \
    -t docker-events-notifier:$VERSION \
    -t docker-events-notifier .

⁠Run

  1. Because this app is just for you, you'll be fine with a Slack Tokens for Testing and Development⁠
⁠Single docker engine

Run the container on a single docker engine, using slack api key and channel.

docker run \
    -d --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e SLACK_API_KEY="xoxp-9999999999-9999999999-9999999999-99999999999999999999999" \
    -e SLACK_CHANNEL="#foo" \
    oguya/docker-event-notifier
⁠Docker swarm mode

Run the container on every node of your swarm.

docker service create \
    --mode global \
    --restart-condition any \
    --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
    -e SLACK_API_KEY="xoxp-9999999999-99999999999-999999999999-99999999999999999999999999999999" \
    -e SLACK_CHANNEL="#foo" \
    --name docker-events-notifier \
    oguya/docker-events-notifier

⁠License

Apache License Version 2.0

Tag summary

Content type

Image

Digest

Size

26.6 MB

Last updated

over 9 years ago

docker pull oguya/docker-event-notifier