Getting bootc initially installed is a little different since it needs an ostree based OS. You could install a bootc image into any running Linux host, but I’ve been playing with Fedora CoreOS and using Ignition/Butane to configure Fedora CoreOS. So let’s use Fedora CoreOS on the host for bootstrapping bootc.
I’ve previously talked about what I like about bootc, and what improvements could be made.
Bootstrapping bootc
There are a few ways to get the bootc image as the host’s OS, but none of those are automated enough for me. Fedora CoreOS to the rescue.
Once the Fedora CoreOS host is up and running, it’s as simple as running:
rpm-ostree rebase --bypass-driver --reboot ostree-unverified-registry:quay.io/fedora/fedora-bootc:41
The OS will automatically reboot into the new Fedora 41 bootc image. And now all future updates will come from the container registry. This is just an example, normally you would have your own custom built container image and not rely directly on the base fedora bootc image.
To check if any updates are available for the bootc image:
bootc upgrade --check && bootc status && systemctl status bootc-fetch-apply-updates.timer bootc-fetch-apply-updates.service
Automatic updates happen from the systemd timer:
systemctl status bootc-fetch-apply-updates.timer
To change the timer to update only during the early hours on the weekend for example:
systemctl edit bootc-fetch-apply-updates.timer
# Add:
[Timer]
OnUnitInactiveSec=
OnCalendar=Sat-Sun *-*-* 04:10:00
RandomizedDelaySec=2h
Save the file and reload the systemd configuration:
systemctl daemon-reload
systemctl status bootc-fetch-apply-updates.timer
To force an upgrade and reboot:
bootc upgrade --apply
If you want to switch to a new OS, like when Fedora 42 comes out:
bootc switch quay.io/fedora/fedora-bootc:42
systemctl reboot
Done. Do you want to rebase to RHEL? Easy.
One thing to keep in mind is that the /etc
directory is not immutable. This means cruft can buildup.
Another benefit to this approach is to leverage the Fedora CoreOS technology to automatically setup (non-root) OS disk storage configurations. For example when you are have a 2nd disk for /var/lib/containers
or /var/lib/docker
.
Conclusion
Getting a Linux OS up and running using a bootc image can be quickly automated if you use Fedora CoreOS as an intermediate step when provisioning a new VM or server.