Get a mail or call a webhook when a docker image gets updated.
10K+
Docker-Notify can send you a mail or call a webhook when a Docker image gets updated.
If you are trying to set docker-notify up on a Synology, here is a guide for that.
$CONFIG_DIR defines the directory where the config is storedThe following notification destinations are supported:
| Type | Description |
|---|---|
| smtpServer | |
| webHooks | Webhook, the $msg variable can be used to insert the docker-notify update message |
config.json.example file to $CONFIG_DIR/config.jsonconfig.json file:
docker-notify.$CONFIG_DIR in the docker-compose file.docker-compose up -ddocker-compose up again.Consider the following scenario:
You have a server with 2 software services.
One is a dockerized webserver and the other one is a dockerized nextcloud image with some customizations, so your docker-compose.yml is looking like this:
version: '3'
services:
webserver:
image: apache2
restart: always
nextcloud:
image: customUser/nextcloud:latest
restart: always
Now you want to be notified if you may update your apache2-server and you want to be notified if you must call your ci-pipeline to rebuild your custom nextcloud-docker-image.
So, now your docker-compose.yml file is looking like this:
version: '3'
services:
webserver:
image: apache2
restart: always
nextcloud:
image: customUser/nextcloud:latest
restart: always
docker-notify:
image: schlabbi/docker-notify
restart: always
volumes:
- /home/someUser/notify/cache:/usr/src/app/cache
- /home/someUser/notify/config.json:/usr/src/app/config.json
The config.json looks like the following:
{
"notifyServices":[
{
"image": "nextcloud:fpm",
"actions": [
{
"type": "mailHook",
"instance": "generalMail",
"recipient": "[email protected]"
},
{
"type": "webHook",
"instance": "gitlabHook"
}
]
},
{
"image": "httpd",
"actions": [
{
"type": "mailHook",
"instance": "generalMail",
"recipient": "[email protected]"
}
]
}
],
"smtpServer": {
"generalMail": {
"host": "mail.example.org",
"port": 25,
"username": "[email protected]",
"password": "PASSWORD",
"sendername": "Docker-Notify",
"senderadress": "[email protected]"
}
},
"webHooks":{
"gitlabHook": {
"reqUrl": "https://ci.example.org",
"httpMethod": "POST",
// This one is optional and will default to null.
"httpBody": {
"foo": [1, 2, 3]
}
},
"slackHook": {
"reqUrl": "https://hooks.slack.com/services/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w",
"httpMethod": "POST",
"httpHeaders": {"Content-type": "application/json"},
"httpBody": {
"text": "$msg"
}
}
}
}
Content type
Image
Digest
sha256:eb34d867a…
Size
47.9 MB
Last updated
almost 3 years ago
docker pull tonyrl/docker-notify