Docker Community Forums

Share and learn in the Docker community.

Slack notification for builds not sent


(Peterlauri) #1

We have been getting slack notifications on successful and failed builds. But about a week ago they have stopped showing up. Stack related slack notifications are still showing up, but nothing from the builds. Someone else with the same experience?


(Geoff Bowers) #2

I wasn’t aware you could get Slack specific webhooks for Docker Hub; that might be useful :slight_smile: Last time I looked there were only generic webhooks so I put together a little container that just relays generic webhooks to slack messages for automated builds.

Just in case anyone is interested, you can find the code on github and a pre-built image on dockerhub:

Or spin it up on Docker Cloud with:

slack-relay:
  image: 'daemonite/slack-relay:latest'
  environment:
    - 'SLACK_HOOK=https://hooks.slack.com/services/MY/SLACK/HOOK'
    - RELAY_PORT=80
    - VIRTUAL_HOST=slack-relay.someday.io
  tags:
    - prod

(Peterlauri) #3

The slack notifications are coming from Docker Cloud builds of repositories, not directly from Docker Hub. The artifacts are stored in Docker Hub, but the build process is inside of Docker Cloud.


(Geoff Bowers) #4

Ah… I get you. Still waiting on Bitbucket support. Its arrival has been imminent for a long time.


(Sergeirodionov) #5

Docker Hub triggers webhook notifications only if the build is successful. Here’s a possible workaround to emulate missing webhooks on failed and queued builds by polling Docker Hub v2 API. It applies only to automated builds.