What's up docker? How to keep your containers up to date

Update sensors show up in this page only if the integration provides the ability to apply the updates from HA (which is not implemented by wud)

Ah ok. Thanks for the info

I am also quite interested in having the upgrade part inside HA.

1 Like

hello together, hello @fmartinou
i hope anybody can help me with my problem.

At the moment, i am building up my HomeAssistant Dashboard und i want to get notified when a new version of my containers is available. For 99% this working flawless.

But i have a Problem with a unifi-container.

    image: lscr.io/linuxserver/unifi-controller:latest

For this one i geht the error
error

The needed environment variable is set in the Compose file

  whats-up-docker:
    container_name: whats-up-docker
    image: fmartinou/whats-up-docker
    restart: unless-stopped 
    ports:
      - 3000:3000
    environment:
#      - WUD_WATCHER_LOCAL_WATCHALL=true
      - WUD_REGISTRY_LSCR_TOKEN=ghp_..........
      - WUD_TRIGGER_MQTT_T_HASS_ENABLED=true
      - WUD_TRIGGER_MQTT_T_HASS_PREFIX=homeassistant
      - WUD_TRIGGER_MQTT_T_URL=$WUD_TRIGGER_MQTT_T_URL
      - WUD_TRIGGER_MQTT_T_USER=$WUD_TRIGGER_MQTT_T_USER
      - WUD_TRIGGER_MQTT_T_PASSWORD=$WUD_TRIGGER_MQTT_T_PASSWORD
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - $DOCKERDIR/wud/store:/store

But when i look at GITHUB, the Token is unusedā€¦ so i think i am missing something and at the moment i have no idea what it is and what i am doing wrong

1 Like

Hi @MikeMunich ,

Your configuration looks ok.
Over time the LSCR integration has changed (sometimes the token was optional, sometimes it was disallowed, sometimes it was requiredā€¦) so it may be that this container was watched a first time while the registry component hadnā€™t initialized well.

I suggest you to:

  1. Stop wud
  2. Remove the $DOCKERDIR/wud/store content
  3. Pull the latest fmartinou/whats-up-docker image
  4. Start wud
  5. Take a look at the logs to check that the lscr registry component has started without failure
  6. Let wud watch the containers
  7. See what happens :crossed_fingers: :wink:
  8. If still ko, then enable the DEBUG logs to help me figure out what happens

Thank you for your suggestions:
After i remoe the ā€œstore-contentā€ it worked - Thank you

I will have a look at it, if it breaks in the future or now everything is working fine

I have recently stumbled onto wud after discovering that my HA container install was not automatically updating as it did previously (was using watchtower) before I moved my image from docker hub to github in my portainer stack. I find the wud instructions quite confusing trying to just create a trigger that will automatically update my containers when a new one is released. Is there a location or something I can go to to understand a bit more about creating a trigger for this?

Hi,

For now, there is no direct support for Portainer stacks.
At the moment, automatic updates only work for Docker or Docker-Compose.

Iā€™m having some problems creating a proper wud.link.template for PhotoPrism. Starting with whatā€™s indicated in comment #26 above, Iā€™ve come up with an expanded wud.tag.include to handle their wacky tagging with commit IDā€™s. What I have currently that works to get proper Up-to-date in HAā€¦

    labels:
      - 'wud.tag.include=^[0-9]{6}-[A-Za-z0-9]{9}$$'
      - 'wud.link.template=https://github.com/photoprism/photoprism/releases/tag/$${raw}'

This results in a proper ā€œInstalled versionā€ in the update sensor of ā€œ231011ā€ which is the latest version and also what I see in the docker container. But $raw in the link is only providing the ā€œ231011ā€ and not the full ā€œ231011-63f708417ā€ as I thought it would. Thus the link to the release notes becomes https://github.com/photoprism/photoprism/releases/tag/231011 which 404ā€™s and not https://github.com/photoprism/photoprism/releases/tag/231011-63f708417 which is the actual link. What do I need to do to get the full raw regex match?

I currently use the MQTT trigger to get the container status into HASS.

I then get HASS to send me a notification via the mobile app. The only notification I can figure out how to generate is if the number of containers that need updating changes.

Has anyone figured out how to get a notification that contains the names of the containers that need updating?

Hi, loving this project! I have WUD communicating with HomeAssistant using a Webhook, and it all works well. I want to configure it to send a request to that webhook endpoint once per day, if any containers need updates. I thought that setting WUD_WATCHER_LOCAL_CRON to the appropriate cron expression would work, but Iā€™m not seeing the results that I expect.

Here is my docker-compose:

  whatsupdocker:
    image: fmartinou/whats-up-docker:latest
    container_name: whatsupdocker
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WUD_TRIGGER_HTTP_HOMEASSISTANTWEBHOOK_URL=${HA_WEBHOOK_URL}
      - WUD_REGISTRY_HUB_LOGIN=${DOCKER_LOGIN}
      - WUD_REGISTRY_HUB_TOKEN=${DOCKER_TOKEN}
      - WUD_WATCHER_LOCAL_CRON=* * * * *
    restart: always
    ports:
      - 3001:3000

I am running every minute to try and debug. Is there something Iā€™m missing? I can see in the logs that the cron is running, but I expected it to query that webhook URL once done.

02:26:12.055  INFO whats-up-docker/api: Server listening on port 3000 (HTTP)
02:26:13.054  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:26:13.060  INFO whats-up-docker/watcher.docker.local: Listening to docker events
02:26:33.561  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:27:00.068  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:27:21.762  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:28:00.085  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:28:19.555  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:29:00.102  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:29:19.809  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:30:00.134  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:30:22.523  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:31:00.147  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:31:21.126  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:32:00.169  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:32:20.350  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:33:00.180  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:33:20.521  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:34:00.194  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:34:20.265  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)
02:35:00.209  INFO whats-up-docker/watcher.docker.local: Cron started (* * * * *)
02:35:20.610  INFO whats-up-docker/watcher.docker.local: Cron finished (29 containers watched, 0 errors, 4 available updates)

Hi @PolarLava ,

I think that this is a bug already logged on the Github repo (unresolved):

Hi @anon43644439 ,

Whatā€™s your CRON expression?
In your post, I see "* * * * * ", which means every minute :thinking: .
Did you try with CRON expressions like ā€œ0 0 * * *ā€ (every night at 00:00)?

The every minute cron expression was me trying to debug this issue.

Ended up figuring it out. To anybody in the future, the cron expression works, but you need to ensure that your trigger ONCE is set to false. In my example, I needed to add the environment variable:

WUD_TRIGGER_HTTP_HOMEASSISTANTWEBHOOK_ONCE=false

Otherwise, the trigger will run once on container start, and never again.

Can you please share your automation, i want to achive the same, maybe we can figure it out.

Hello everyone! I know how to use the WUD_TRIGGER_DOCKER_AUTOUPDATE_PRUNE to have containers automatically pull the latest image and update but is there a way to specify which containers this applies to or exclude containers from auto-updating?

Thanks in advance for the help!

I added this to the stacks I donā€™t want to update.

labels:
- wud.watch=false # Do Not Watch This Container

Thank you but will this still notify me when those containers have updates? Iā€™d still like the update notification but without the auto-update for a few containers.

Ok figured it out by myself, still need to beautify it, but at least i get now a notification whenever there is a update also with the exact note, which container can be updated.

Full automation:

alias: Notify - What's Up Docker
description: Benachrichtigung fĆ¼r Docker Updates
trigger:
  - platform: state
    entity_id:
      - sensor.wud_container_update_count
condition: []
action:
  - service: notify.mobile_app_iphone
    data:
      title: Docker Update
      message: >-
        Update verfĆ¼gbar {{
        states.update|selectattr('state','eq','on')|selectattr('object_id',
        'search', '^wud_')|map(attribute='entity_id')|list }}
mode: single

If somebody has a better idea, then please :slight_smile:

1 Like

Hello all,
I got WUD running for some time now but now i want to add a update function but not sure how to start.
I have seen triggers docker-compose and docker but how do i configure it?
Should i add every docker-compose file for each container in? (Iā€™m using Portainer)

And i guess there is no option to manual trigger the update from within HA or from WUD GUI?

1 Like