Minor update on bootc
2025-03-31
In my previous post, I tried to build an Arch Linux VM image using bootc-image-builder and hit a bunch of problems:
In arch-bootc:
- Local builds of bootc/bootupd assume an Arch host.
podman build
command doesn’t work on my machine. (Slightly curious why… SELinux?)rm /var/cache/pacman/pkg/* &&
is missing a backslash on the end.rm /var/cache/pacman/pkg/* &&
is trying to delete a directory that didn’t exist for me.In bootc-image-builder:
- Auto-selection of rootfs type apparently depends on the container having a bootc binary inside the container.
- Assumption of VERSION_ID in container’s /etc/os-release
- Assumption of PLATFORM_ID in container’s /etc/os-release (this is likely to bite Fedora soon)
- Apparent hard dependency on
dnf
in the container.
Since then, I’ve filed some issues and a PR, learned more about how the different parts interact, and figured out an easier way to patch a Containerfile in place, so I wanted to write that up.
First, I created a PR for the Containerfile problems in arch-bootc which has since been merged, so there are fewer steps to use that image in my environment.
Second, I realized that it was much easier to non-interactively patch the Containerfile to not use local pkgbuilds:
sed -i /pkgbuilds/d Containerfile
Third, I experimented and discovered that (as I kinda suspected) the
podman build
step doesn’t need
--device /dev/fuse
.
As such, today the steps to reproduce my work can be boiled down to:
git clone --depth 1 https://github.com/frap129/arch-bootc.git
cd arch-bootc
sed -i /pkgbuilds/d Containerfile
sudo podman build . -t arch-bootc --net=host --cap-add all --security-opt=label=disable
mkdir output
sudo podman run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type qcow2 \
--use-librepo=True \
--rootfs ext4 \
localhost/arch-bootc
Also, I turned my bootc-image-builder problems into actual issues:
- Assumption of
VERSION_ID
in container’s/etc/os-release
: bootc-image-builder #870 - Assumption of
PLATFORM_ID
in container’s/etc/os-release
: bootc-image-builder #868 - Apparent hard dependency on
dnf
in the container: bootc-image-builder #869