🚀 A little bash script for alert and autoupdate containers deployed with docker run, docker-compose or Portainer.
🔵 Support of Docker hub (docker.io) and Github (ghcr.io) registries
🟣 Send notification to Discord (optionnal)
🔴 Send data to Zabbix (optionnal)
🔆 Discord notification example :
jq, zabbix-sender (if you use Zabbix)
git clone https://github.com/PAPAMICA/container-updater
cd container-updater
./container-updater.sh
If you use Github as registry, you need to set your personnal access token:
-g <access_tocken>
You can send notification to Discord with this argument:
-d <discord_webhook>
You can send data to Zabbix with this argument:
-z <zabbix_server>
-n <host_name> (optional)
You can blacklist packages for autoupdate:
-b <package,package>
00 09 * * * /chemin/vers/container-updater.sh -d <discord_webhook> -b <package,package> -z <zabbix_server> >> /var/log/container-updater.log
To supervise the updates of a container, you just have to add this label:
labels:
- "autoupdate=monitor"
In this case, if an update is available, the script will simply send a notification to Discord. All you have to do is update the container.
To activate the automatic update of the container, you must add these labels:
-l "autoupdate=true" -l "autoupdate.docker-run=true"
labels:
- "autoupdate=true"
- "autoupdate.docker-compose=/link/to/docker-compose.yml"
You need to have Portainer in enterprise version (free license up to 5 nodes). You can find the webhook in the stack or container settings.
labels:
- "autoupdate=true"
- "autoupdate.webhook=<webhook_url>"
- Add private registry support
- Better json generate for Discord notification
- Others notifications support