Keep your containers updated with What's up Docker?
Container Cadence
© Lead Image © Ulrich Müller, 123RF.com
Keeping multiple Docker containers updated reliably can become quite a challenge. Enter What's up Docker?
When you start running various services in containers on your home servers, you'll need a reliable method to keep them updated. Projects continuously release new versions, not only to introduce new features, but also to address security vulnerabilities. So even if you're satisfied with the current feature set, neglecting updates can expose you to security risks.
However, updating your containers also comes with some risks. A new version might introduce incompatible changes, demanding your attention. In the worst case, you need to spend several hours resolving those issues, and of course this always happens at the most inconvenient times. So it's not recommended to just periodically update all your containers to the latest version or automatically install every new release and hope for the best.
Best Practices
How do you manage these risks? Before performing any updates, you should review the release notes of each new container version to check for breaking changes. However, this requires finding these release notes first. Therefore, you need a system that notifies you when a new update becomes available, preferably with a direct link to the release notes to save time.
Moreover, a robust update strategy demands control over the exact versions you install. If you use a latest tag to fetch the newest image version of a container, you might download a different version than intended, potentially causing compatibility issues. Specifying the exact versions of all your container images to download, using tags such as v1.3.2, can prevent such problems.
What's up Docker?
What's up Docker? (WUD) [1] is a practical tool that can help you maintain these best practices. The program has three main components: watchers, registries, and triggers (see Figure 1 for an architecture overview). Watchers scan and monitor containers on your local Docker host and/or other networked Docker hosts. Registries check online Docker registries such as Docker Hub [2] for available image updates. Triggers spring into action when an update for one of your containers is detected, notifying you via email, a webhook, MQTT, an update script, or other actions such as updating your Docker Compose file.
Notification triggers include a link to the release notes of the detected version, enabling you to easily review the changes. Additionally, WUD features a web interface where you can view the status of all your containers at any time. Because WUD can set up watchers for multiple Docker hosts, a single WUD installation provides an overview of containers across all your Docker hosts in one web interface.
Installing WUD
The simplest way to run WUD is as a Docker container. Assuming that all your containers are configured in a Docker Compose file, you will add WUD to this setup. To correctly monitor the version of the WUD image itself, specify the version number. Your docker-compose.yml file will resemble Listing 1.
Listing 1
WUD Container Definition in docker-compose.yml
services:
whatsupdocker:
image: getwud/wud:8.1.1
container_name: wud
restart: unless-stopped
ports:
- 3000:3000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
The /var/run/docker.sock socket, which you mount into the container, enables WUD to query the versions (or, more accurately, the tags) of the local container images.
Ensure that you add version tags to other containers in your docker-compose.yml, if not already done. (If you're using Podman, see the "Using WUD with Rootless Podman Containers" box.) You'll need to find the correct tags on the Docker Hub page of the image or the registry where you downloaded it from. Some tags might have a v prefix, such as v0.1.53. Save your changes to the file and restart your containers with docker-compose up -d. Then, visit the WUD web interface at http://IP:3000, where IP is the IP address of your Docker host (Figure 2).
Using WUD with Rootless Podman Containers
Despite its name, What's up Docker? works perfectly with Podman, including rootless Podman containers. The only adjustment you need is in mounting the Docker socket. Instead, the volume resembles /run/user/1000/podman/podman.sock:/var/run/docker.sock:ro, where /run/user/1000/podman/podman.sock is your user's Podman socket. You can find this in the output of podman info under RemoteSocket. In the container, this socket is just mounted into the location where WUD expects it, /var/run/docker/sock.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
UN Creates Open Source Portal
In a quest to strengthen open source collaboration, the United Nations Office of Information and Communications Technology has created a new portal.
-
Latest Linux Kernel RC Contains Changes Galore
Linux kernel 7.0-rc3 includes more changes than have been made in a single release in recent history.
-
Nitrux 6.0 Now Ready to Rock Your World
The latest iteration of the Debian-based distribution includes all kinds of newness.
-
Linux Foundation Reports that Open Source Delivers Better ROI
In a report that may surprise no one in the Linux community, the Linux Foundation found that businesses are finding a 5X return on investment with open source software.
-
Keep Android Open
Google has announced that, soon, anyone looking to develop Android apps will have to first register centrally with Google.
-
Kernel 7.0 Now in Testing
Linus Torvalds has announced the first Release Candidate (RC) for the 7.x kernel is available for those who want to test it.
-
Introducing matrixOS, an Immutable Gentoo-Based Linux Distro
It was only a matter of time before a developer decided one of the most challenging Linux distributions needed to be immutable.
-
Chaos Comes to KDE in KaOS
KaOS devs are making a major change to the distribution, and it all comes down to one system.
-
New Linux Botnet Discovered
The SSHStalker botnet uses IRC C2 to control systems via legacy Linux kernel exploits.
-
The Next Linux Kernel Turns 7.0
Linus Torvalds has announced that after Linux kernel 6.19, we'll finally reach the 7.0 iteration stage.
