BOOTC-LOCAL-BUILDS(7)
π¦ BOOTC-LOCAL-BUILDS π¦
okay bestie so this is a page from the Miscellaneous Information Manual, and it's literally all about booting local builds. no cap, this is the β¨loreβ¨ you need. π
β¨ NAME β¨
bootc-local-builds β Booting local builds π«Ά
πΈ DESCRIPTION πΈ
so sometimes you're in a scenario where you wanna boot a container image you built locally, right? like maybe you need to slap a persistent hotfix onto one specific server, or you're deep in a development/testing arc and this is just the vibe. either way, it's giving local builds. π
π Building a new local image π
okay so first thing, and this is important: at the current time, the bootc host container storage is distinct from the podman container runtime storage (and the default configuration lives in /var/lib/containers). they're not the same place, they do not share, periodt.
and it's not currently streamlined to export the booted host container storage into the podman storage. so like, that shortcut? doesn't exist yet bestie. π
hence today, if you wanna replicate the exact container image the host has booted, here's what you do: take the container image referenced in bootc status and turn it into a podman pull invocation.
next, craft a container build file with your desired changes:
FROM <image>
RUN apt|dnf upgrade https://example.com/systemd-hotfix.package
see? easy. iconic. π
π¦ Copying an updated image into the bootc storage π¦
this command is straightforward, no stress: we just need to tell bootc to fetch updates from containers-storage, which is the local "application" container runtime (podman) storage:
$ bootc switch --transport containers-storage quay.io/fedora/fedora-bootc:40
from there, the new image will be queued for the next boot and a reboot will apply it. main character energy fr fr. π
for more on valid transports, see containers-transports at https://github.com/containers/image/blob/main/docs/containers-transports.5.md. β
π Automating local rebuilds π
so the build and switch above? you can totally automate that with a systemd service and timer. for example, keep the build context in /var/lib/machine-bootc and build the image on a schedule:
# /etc/systemd/system/machine-bootc-build.service
[Unit]
Description=Build the machine-local bootc image
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
WorkingDirectory=/var/lib/machine-bootc
ExecStart=/usr/bin/podman build --security-opt=label=disable --pull=newer --tag localhost/machine-bootc:latest .
# /etc/systemd/system/machine-bootc-build.timer
[Unit]
Description=Build the machine-local bootc image daily
[Timer]
OnCalendar=*-*-* 06:00:00
Persistent=true
[Install]
WantedBy=timers.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now machine-bootc-build.timer
β¨ and that's it, that automates only the build. staging the new image with bootc switch and rebooting are intentionally left as explicit operations β so automate them only with a reboot policy appropriate for the machine. π like, don't go rogue on the reboots, bestie.
π okay so real talk: automating the rebuild is only worthwhile if the build reliably produces a new image when, and only when, an input changed. with --pull=newer an identical rebuild is a full cache hit and yields the same image, so nothing new gets deployed. but β and this is the tea β that relies on the build cache, not on reproducible output. a step whose result is not deterministic (regenerating an initramfs is a common example) can produce a different image on a cache-busted rebuild even when nothing meaningful changed, which causes needless reboots. π prefer reproducible build steps for anything driven on a timer. no cap, this one matters.
π SEE ALSO π
π VERSION π
v1.17.1
and that's the whole page bestie!! you're now officially a bootc-local-builds expert, slay π this was BOOTC-LOCAL-BUILDS(7) from the Miscellaneous Information Manual, version v1.17.1 β go forth and boot responsibly, mwah πβ¨π¦
π¦ where this page comes from
- fedora 43: bootc 1.17.1-1.fc43 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
- fedora 44: bootc 1.17.1-1.fc44 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms