I’m running Silverblue 38 and I’d like to automatically update my Toolbx containers. I want my system to periodically reach out to the remote image registry to see if a Toolbx image has been updated, pull it down if a new one is found, and then recreate the Toolbx based on the new image.
I’ve tried to do this using Podman’s Quadlet feature, which relies on systemd to manage containers and volumes, but have been unsuccessful. I used the initial example in podman-auto-update(1) to start my little project.
From that example, I was able to have a new image automatically pulled down upon detection of a different container image digest, which is great. The Quadlet file I’m using (see below) defines an official Toolbx image. The fundamental issue: the container produced through this process is incompatible with Toolbx.
Running toolbox list
doesn’t show the resulting “systemd-fedora-toolbox” container, while podman container list
does. When entering the new container, I’m greeted by a vanilla prompt (the prepended diamond symbol is gone). Additionally, the usual file to help you identify a Toolbx container is missing:
$ podman exec systemd-fedora-toolbox stat /run/.toolboxenv
stat: cannot statx '/run/.toolboxenv': No such file or directory
I assume the general problem is related to podman
being called directly instead of toolbox
, and so the toolbox init-container
command isn’t being used for the container’s entry point. Other reasons aside, my newness to the tech is most likely why it’s not working.
Any insights or pointers would be appreciated.
Contents of the Quadlet .container file.
cat $HOME/.config/containers/systemd/fedora-toolbox.container
[Container]
Image=registry.fedoraproject.org/fedora-toolbox:39
Exec=sleep infinity
AutoUpdate=registry
Contents of the service file generated by Quadlet.
/usr/libexec/podman/quadlet -dryrun -user
quadlet-generator[1091319]: Loading source unit file /var/home/jrandom/.config/containers/systemd/fedora-toolbox.container
---fedora-toolbox.service---
[X-Container]
Image=registry.fedoraproject.org/fedora-toolbox:39
Exec=sleep infinity
AutoUpdate=registry
[Unit]
SourcePath=/var/home/jrandom/.config/containers/systemd/fedora-toolbox.container
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/usr/bin/podman rm -f -i --cidfile=%t/%N.cid
ExecStopPost=-/usr/bin/podman rm -f -i --cidfile=%t/%N.cid
Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/usr/bin/podman run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm --cgroups=split --sdnotify=conmon -d --label io.containers.autoupdate=registry registry.fedoraproject.org/fedora-toolbox:39 sleep infinity