Sign inSign up

inverscom/slack-docker

By inverscom

•Updated about 6 years ago

Image
0

181

inverscom/slack-docker repository overview

⁠slack-docker CircleCI

A Slack integration to notify Docker events⁠.

slack-docker-screenshot

⁠Getting Started

Setup an Incoming WebHook⁠ on your Slack workspace and get the WebHook URL.

# Docker
docker run -d \
      -e webhook=https://hooks.slack.com/services/... \
      -h "$(hostname)" \
      -v /var/run/docker.sock:/var/run/docker.sock \
      inverscom/slack-docker

# Docker Compose
curl -O https://raw.githubusercontent.com/int128/slack-docker/master/docker-compose.yml
docker-compose up -d

⁠Configuration

It supports the following options and environment variables:

Application Options [env-variable]:
      --webhook [$webhook]                      = Slack Incoming WebHook URL
      --image-regexp [$image_regexp]            = Filter events by image name (default to all) 
      --container-name-regexp [$container_name_regexp]    = Filter events by container name (default to all) 
      --action-regexp [$action_regexp]          = Filter events by action (default to all) - possible values: https://docs.docker.com/engine/reference/commandline/events/
      --type-regexp [$type_regexp]              = Filter events by type (default to all) - possible values: https://docs.docker.com/engine/reference/commandline/events/
      --title-link [$title_link]                = Link for the title in slack (e.g. link to a protainer on this docker host)

Help Options:
  -h, --help          Show this help message

⁠Examples

⁠Only send messages for containers with specific image
docker run -d \
      -e webhook=https://hooks.slack.com/services/... \
      -e image_regexp='^alpine$' \
      -e type_regexp=container \
      -e title_link=http://xxx \
      -h "$(hostname)" \
      -v /var/run/docker.sock:/var/run/docker.sock \
      inverscom/slack-docker
⁠Only send messages for start and die events for containers with specific container name
docker run -d \
      -e webhook=https://hooks.slack.com/services/... \
      -e container_name_regexp=webserver \
      -e type_regexp=container \
      -e action_regexp=start|die \
      -e title_link=http://xxx \
      -h "$(hostname)" \
      -v /var/run/docker.sock:/var/run/docker.sock \
      inverscom/slack-docker

⁠Contribution

This is an open source software licensed under Apache-2.0. Feel free to open issues or pull requests.

Tag summary

Content type

Image

Digest

Size

9.7 MB

Last updated

about 6 years ago

docker pull inverscom/slack-docker