Auto Update Podman Quadlet Images
I recently wrote about moving from Docker Compose to Podman Quadlets. I haven't had any issues with the configuration so far, but I did make one change today.
My old setup made it easy to pull newer versions of images when I wanted by running docker compose down followed by docker compose up --pull=always -d to actually pull new images and restart the services. It was a manual process, but it was easy.
Today, I looked into how I'd accomplish the equivalent action for my Podman Quadlets. It turns out that Podman has a fancy way to do this more or less automatically.
First, you must enable a systemd timer that Podman provides for doing automatic updates.
systemctl --user enable --now podman-auto-update.timer
Note that I'm enabling this timer at the user level. That's important since my Quadlets are also user level. The timer needs to run at the same level as the Quadlet services.
Second, update the Quadlet files so that AutoUpdate=registry is added in the [Container] section of the file.
# /home/server-user/.config/containers/systemd/plex.container
[Unit]
Description=Plex Media Server
After=network.target
[Container]
Image=lscr.io/linuxserver/plex:latest
AutoUpdate=registry
Network=host
UserNS=keep-id
Environment=TZ=America/Chicago
Environment=VERSION=docker
Environment=PLEX_CLAIM=claim-8HmexoK3GpeAGk2PcyC7
Volume=/home/server-user/plex/config:/config:Z
Volume=/media/wd-gold/Television:/tv:Z
Volume=/media/wd-gold/Movies:/movies:Z
AddDevice=/dev/dri:/dev/dri
PublishPort=32400:32400/tcp
[Service]
Restart=always
[Install]
WantedBy=default.target
# /home/server-user/.config/containers/systemd/tiddlywiki.container
[Unit]
Description=TiddlyWiki
After=network.target
[Container]
Image=docker.io/library/node:lts-alpine
AutoUpdate=registry
UserNS=keep-id
Exec=npx --yes tiddlywiki /wiki --listen host=0.0.0.0 port=8080
Volume=/home/server-user/wiki:/wiki:Z
PublishPort=80:8080/tcp
[Service]
Restart=always
[Install]
WantedBy=default.target
After updating the Quadlets, reload the systemd daemon and restart the services, and everything should be ready to go. Podman should check for new images daily and restart the services when appropriate.
systemctl --user daemon-reload
systemctl restart --user plex.service
systemctl restart --user tiddlywiki.service