RH134 Ch 12: Image Mode for RHEL (bootc)
In package mode — the classic way — you install RHEL, then change it over time with dnf, config edits and scripts, so every server slowly drifts. Image mode treats the whole operating system as a container image: you describe it in a Containerfile, build it with podman, push it to a registry and let hosts boot from it. Every host running image :1.4 is identical.
Building. Start from a bootc base image, which (unlike an application image) contains the kernel, systemd and the bootc tool:
dockerfile FROM registry.redhat.io/rhel10/rhel-bootc:10.0 RUN dnf -y install httpd && dnf clean all RUN systemctl enable httpd COPY index.html /var/www/html/index.html
bash podman build -t registry.lab.example.com/webasha/kiosk:1.0 . podman push registry.lab.example.com/webasha/kiosk:1.0
Services are enabled at build time. bootc-image-builder turns the image into an ISO, qcow2 or cloud image for the first install, or kickstart can install it with the ostreecontainer command.
File system rules. /usr is read-only and comes from the image. /etc is merged: local changes are kept across updates. /var belongs to the machine — the image seeds it at first install only, so later images do not overwrite data there.
Day-2 operations.
bash bootc status booted, staged and rollback images bootc upgrade fetch and stage a newer build of the same image bootc switch registry.lab.example.com/webasha/kiosk:2.0 move to another image bootc rollback boot the previous deployment next time
Updates are staged side by side and take effect at the next reboot, so an update is atomic: either the new image boots or you roll back. bootc-fetch-apply-updates.timer can automate upgrades.
Common mistakes - Using an application base image (such as UBI) — it cannot boot. - Expecting dnf install on a running image-mode host to persist; change the Containerfile instead. - Putting content in /var and expecting updates to replace it.