Skip to content

A little bash script for alert and autoupdate container with Portainer.

Notifications You must be signed in to change notification settings

PAPAMICA/container-updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 

Repository files navigation

PAPAMICA

🚀 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 : ohunebellenotif

Requirements

jq, zabbix-sender (if you use Zabbix)

Use

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>

For a daily execution, add a cron

00 09 * * * /chemin/vers/container-updater.sh -d <discord_webhook> -b <package,package> -z <zabbix_server> >> /var/log/container-updater.log

Monitoring

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.

Auto-update

To activate the automatic update of the container, you must add these labels:

docker run

-l "autoupdate=true" -l "autoupdate.docker-run=true"

docker-compose

labels:
    - "autoupdate=true"
    - "autoupdate.docker-compose=/link/to/docker-compose.yml"

Portainer

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>"

To Do

  • Add private registry support
  • Better json generate for Discord notification
  • Others notifications support

About

A little bash script for alert and autoupdate container with Portainer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages