Receive Slack notifications when a container dies
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 containers' information to the selected Slack channel.
You must create a release tag in order to build and publish this image.
./build-all.sh
- Because this app is just for you, you'll be fine with a Slack Tokens for Testing and Development
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" \
socialmetrix/docker-events-notifier:${VERSION}
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 \
socialmetrix/docker-events-notifier:${VERSION}
Apache License Version 2.0