Keep your containers updated with What's up Docker?

Monitor Version Tags

Clicking on the container block on WUD's homepage will display a list of containers running on the same host, along with their image version. Because the WUD container has access to the Docker socket, it can retrieve this information directly from the Docker engine for all containers. You can quickly identify whether a container is outdated, with a suggestion to upgrade to a specific version.

Overall, this process works well, though WUD occasionally requires some guidance. By default, it even misinterprets information about WUD itself. WUD might suggest upgrading from version 8.1.1 to an image tagged as 667-feature-request-support-for-homarr-labs-dashboards-icons (Figure 3), which is not a regular version. The developer uploaded an image with this tag for testing on Docker Hub, and WUD sees 667 as a larger number than eight, thereby suggesting it as an upgrade. Thankfully, you can add a label to the Docker container with a regular expression that filters which tags you want to consider as versions. For the typical major.minor.patch format, add the label as follows to the WUD container in docker-compose.yml:

labels:
      - wud.tag.include=^\d+\.\d+\.\d+$$
Figure 3: You need to tell WUD not to consider this type of version tag.

Note that you need to duplicate every dollar sign in the regular expression.

After running docker-compose up -d, WUD will focus solely on tags that start with digits followed by a period, more digits, another period, and again more digits. If the tags of a container image always start with a v, add that v before the first \d in the regular expression. If the container also offers Alpine-based versions, you typically obtain those by appending -alpine before the $$. With the right regular expressions, you now have a nice overview of available updates for all your containers (Figure 4).

Figure 4: WUD shows patches in green, minor releases in orange, and major releases in red.

Release Notes

Now that you know which new versions are available for your containers, you need to find the release notes. These are usually published on predictable URLs, so you can label each container to specify how the link to the release notes of a specific version looks. For projects whose releases are published on GitHub, add a link by attaching a label like this to the container:

- wud.link.template=https://github.com/getwud/wud/releases/tag/$${major}.$${minor}.$${patch}

If your project uses a different versioning system than major.minor.patch, you can also use $${original} for the full image tag. WUD inserts the version number into the URL to provide the correct release notes URL for each new version. Remember to duplicate any dollar sign.

You can also customize the name and icon WUD displays for the container with the following labels (see the box "Icon Sources" for where to find icons):

- wud.display.name=What's up Docker
      - wud.display.icon=sh-wud

Icon Sources

WUD supports icons from various websites to display alongside your containers. You can indicate the source using a prefix: sh- for selfh.st [3]; si- for Simple Icons [4]; mdi- for Material Design Icons [5]; hl- for Dashboard Icons [6]; and fab-, far-, and fas- for brand, regular, and solid icons, respectively, from Font Awesome [7]. Simply search for a project on one of these websites and use the name from the search results with the appropriate prefix in the label for your container.

Now add the same information with labels for the other containers in your Docker Compose file. After running docker-compose up -d, your container list in WUD will become much clearer, with an icon and readable name for each container. When you expand a container's entry, you'll also see a clickable link to the release notes of the new version that WUD found (Figure 5).

Figure 5: WUD shows a clickable link for the release notes of this container's update.

Adjust the Default Watcher

Notice that WUD has one watcher configured in its web interface. WUD creates this by default if you don't set any up. Clicking on 1 watchers on the homepage expands to show a docker / local watcher. Clicking it reveals its properties, such as the configured Docker socket. The property Cron is set to 0 * * * *, indicating WUD checks for updates every hour. For more information on this notation, visit Crontab Guru [8].

Additionally, Watchall is set to false, meaning WUD checks only running containers for updates instead of all created ones. Watchbydefault, set to true, implies containers don't need to specify that they should be monitored by WUD. If you wish to monitor only specific containers, you need to set this to false and label containers you want to monitor with wud.watch=true. When Watchevents is set to true, WUD checks for updates upon a container's start.

To modify the default watcher's properties, you must set environment variables for the WUD container. For example, to monitor updates only once a day at 3:05am, add this environment variable to the WUD container in docker-compose.yml:

environment:
      - WUD_WATCHER_LOCAL_CRON=5 3 * * *

Other properties of the watcher have corresponding environment variables, for example, WUD_WATCHER_LOCAL_WATCHBYDEFAULT for Watchbydefault. After running docker-compose up -d, your local watcher configuration will be updated.

Buy this article as PDF

Download Article PDF now with Express Checkout
Price $2.95
(incl. VAT)

Buy Linux Magazine

Related content

  • Push Notifications

    If you host a lot of services on your home server, it helps to have them send you timely notifications. With ntfy, you can send push notifications to your phone or desktop.

  • Chore Conqueror

    Are you struggling to keep track of all your household chores? With its intuitive interface and advanced features, Donetick ensures you won't forget them.

  • Docker Open Source Developer Tools

    Docker provides the open source tools and resources for compiling, building, and testing containerized applications.

  • Plant-it

    To keep your garden and indoor plants alive, you must remember to water them on time, apply fertilizers, and more. Plant-it is a self-hosted garden companion designed to assist you in achieving these tasks.

  • Seafile 9

    Seafile offers file sharing and synchronization like Nextcloud and ownCloud, but its speed leaves the competition far behind.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News