/docker-events-pushover

Receive a PushOver notification on Docker events

Primary LanguagePythonApache License 2.0Apache-2.0

Docker Events Pushover

Receive Pushover notifications when on docker container events

FORK:

Added send limits. -phynias

How it works

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

When specified events are triggered it sends the affected containers' information to PushBullet.

If no events are specified in the enironment variables, these are the default ones: "create","update","destroy","die","kill","pause","unpause","start","stop"

If the label docker-events.ignore is specified, then that container will not be checked.

Build

You must create a release tag in order to build and publish this image.

./build-all.sh

Run

First, get a Pushover account (https://https://pushover.net/) Then, make a note of your User Key Then, create a new Application within Pushover, and make a note of the Token

Run (default events)

docker run \
    -d --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e PUSHOVER_TOKEN="INSERT-TOKEN-HERE" \
    -e PUSHOVER_KEY="INSERT-KEY-HERE" \
    derekoharrow/docker-events-pushover:latest

Run (custom events)

docker run \
    -d --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e PUSHOVER_TOKEN="INSERT-TOKEN-HERE" \
    -e PUSHOVER_KEY="INSERT-KEY-HERE" \
    -e EVENTS="die,destroy,kill"
    derekoharrow/docker-events-pushover:latest

Run (Docker Compose/Stack)

version: '2'
 
services:
  docker-events:
    container_name: docker-events
    image: derekoharrow/docker-events-pushover:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - PUSHOVER_TOKEN=INSERT-TOKEN-HERE
      - PUSHOVER_KEY=INSERT-KEY-HERE
      - EVENTS=die,destroy,kill
    restart: unless-stopped

License

Apache License Version 2.0