Pushover notifications on Docker image updates
Published on Sep 13, 2024I'm running a bunch of Docker images on my server and keeping them up to date is something I enjoy (I know). I was looking for something simple that will let me know if there's a new version for one of the images I'm running. I discovered Diun, which just hooks into the Docker deamon, keeps track of which images are used and periodically checks if there's a new version available.
If there's a new version it can send a notification through a variety of services. That's already the one job it has and it does that very well. Setting it up took a few minutes and it has been doing its job ever since. The current Docker Compose configuration I'm using looks like this:
diun:
image: crazymax/diun:latest
command: serve
volumes:
- "/home/ubuntu/services/diun/data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ=Europe/Berlin"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=0 */6 * * *"
- "DIUN_WATCH_JITTER=30s"
- "DIUN_PROVIDERS_DOCKER=true"
- "DIUN_WATCH_HEALTHCHECKS_BASEURL=https://hc-ping.com/"
- "DIUN_WATCH_HEALTHCHECKS_UUID=redacted"
- "DIUN_NOTIF_PUSHOVER_TOKEN=redacted"
- "DIUN_NOTIF_PUSHOVER_RECIPIENT=redacted"
- "DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true"
labels:
- "diun.enable=true"
restart: unless-stopped
One thing that took me a moment was that I had to set DIUNPROVIDERSDOCKER_WATCHBYDEFAULT
to true, as otherwise you'd have to add a label to all your containers to whitelist the ones you actually want to watch.