Skip to content

trollkarlen/docker-events-pushbullet

 
 

Repository files navigation

Docker Events PushBullet

Receive PushBullet notifications when on docker container events

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"

Build

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

./build-all.sh

Run

First get a PushBullet Access Token

Run (default events)

docker run \
    -d --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e PB_API_KEY="INSERT-KEY-HERE" \
    jmc265/docker-events-pushbullet:latest

Run (default events, ignore self)

docker run \
    -d --restart=always \
    --name docker-events-pushbullet \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e IGNORE_NAMES=docker-events-pushbullet \
    -e PB_API_KEY="INSERT-KEY-HERE" \
    jmc265/docker-events-pushbullet:latest

Run (custom events)

docker run \
    -d --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e PB_API_KEY="INSERT-KEY-HERE" \
    -e EVENTS="die,destroy,kill"
    jmc265/docker-events-pushbullet:latest

Run (Docker Compose/Stack)

version: '2'

services:
  docker-events:
    container_name: docker-events
    image: jmc265/docker-events-pushbullet:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - PB_API_KEY=INSERT-KEY-HERE
      - EVENTS=die,destroy,kill
    restart: unless-stopped

Testing

Your need python3.9 and virtualenv installed

virtualenv --python python3.9 .py39
. .py39/bin/activate
python3 -m pip install tox
tox

License

Apache License Version 2.0

About

Receive a PushBullet notification on Docker events

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 80.3%
  • Shell 12.2%
  • Dockerfile 7.5%