https://github.com/jenkinsci/dockerhub-notification-plugin
https://github.com/jenkinsci/dockerhub-notification-plugin
docker
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jenkinsci/dockerhub-notification-plugin
- Owner: jenkinsci
- License: mit
- Created: 2015-05-20T11:59:51.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-03-24T05:37:27.000Z (over 1 year ago)
- Last Synced: 2025-03-30T06:08:38.392Z (over 1 year ago)
- Topics: docker
- Language: Java
- Homepage: https://plugins.jenkins.io/dockerhub-notification/
- Size: 682 KB
- Stars: 41
- Watchers: 105
- Forks: 47
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
CloudBees Docker Hub/Registry Notification
================
This plugin provides integration between
* Jenkins and Docker Hub
* Jenkins and Docker Registry 2.0
It does so by utilizing webhooks to trigger one (or more) Jenkins job(s).
This allows you to implement continuous delivery pipelines based on Docker in Jenkins.
When Jenkins receives a notification of an updated image that is a web-hook from
Docker Hub, it triggers all jobs that have the Docker Hub
trigger enabled and use the Docker image as part of the build. A
Docker Hub Pull build step is provided to retrieve the latest image from
Hub.
# Configuring Docker Hub
On the Jenkins Configure Global Security page add an api key.

Configure your Docker Hub repository with a webhook to your public jenkins instance `http://JENKINS/dockerhub-webhook/{api-key}/notify`
In your hub.docker.com repository, you can find the "webhooks" section and point it to your jenkins instance:

# Configuring Docker Registry 2.0
Follow Docker Registry 2.0 [documentation](https://docs.docker.com/registry/notifications/) on how to configure registry so that it would send notifications to `http://JENKINS/dockerregistry-webhook/{api-key}/notify`
The simplest viable configuration looks like this:
```
notifications:
endpoints:
- name: jenkinslistener
url: http://JENKINS/dockerregistry-webhook/{api-key}/notify
timeout: 500ms
threshold: 5
backoff: 1s
```
# Configuring Azure Container Registry
You can find a detailed guide on how to configure webhooks on ACR on
[docs.microsoft.com](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-webhook).
Use `http://JENKINS/acr-webhook/{api-key}/notify` as a "Service URI".
# Examples
Payloads submitted by the hub:
* [Payload from your own repository](src/test/resources/own-repository-payload.json).
* [Payload from a public repository](src/test/resources/public-repository-payload.json).
Payloads submitted by the registry:
* [Payload from your own registry](/src/test/resources/private-registry-payload-1-repository.json).
The plugin can be tested with
```bash
curl -X POST -H "Content-Type: application/json" http://localhost:8080/jenkins/dockerhub-webhook/{api-key}/notify -d @src/test/resources/public-repository-payload.json
```