bootc-image-builder icon indicating copy to clipboard operation
bootc-image-builder copied to clipboard

How to use without dnf

Open yjftsjthsd-g opened this issue 9 months ago • 5 comments

This somewhat mirrors https://github.com/coreos/bootupd/issues/468 . I'd like to use bootc-image-builder to build bootable images of distros that don't use RPM/DNF (most immediately Arch Linux, though my actual goal is postmarketOS). Right now, I can hack around some minor problems (details in my writeup https://brianecole.com/blog/2025-03-27_bootc-movingarch.html , but I'll file separate issues for those), but the show-stopper is this:

[-] Manifest generation step
Message: Generating manifest manifest-qcow2.json
2025/03/27 22:53:27 error: cannot build manifest: initializing dnf in 349dc08b74e9b50c9a5af43d1c28a49bafffeb1a622977babf01026e4ba57318 container failed: exit status 127
output:
Error: crun: executable file `dnf` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found

If bootc-image-builder is intended to work for non-Red Hat-family OSs, then it shouldn't depend on any specific package manager.

Also, why is it calling a package manager at all? I would have naively expected that you could even make a bootable VM from a FROM scratch image so long as it had a kernel and maybe a bootloader(?) on the expected paths.

yjftsjthsd-g avatar Mar 28 '25 18:03 yjftsjthsd-g

The dnf call is needed for ISO builds. I think we just unconditionally run it in a prep phase here to initialise repository configs, but we should only do that for ISOs.

achilleas-k avatar Mar 28 '25 19:03 achilleas-k

I've moved the two other tickets that @yjftsjthsd-g created under this one; both of those are there because we use them to form a (dnf) depsolver based on information in the container.

If that's not correct please un-subissue them again :)

supakeen avatar Mar 28 '25 20:03 supakeen

The dnf call is needed for ISO builds.

On that topic though, https://github.com/rhinstaller/anaconda/discussions/5888 is very relevant. If we think of "ISO builds" as two very distinct things ("prepare content of live ISO's rootfs etc" and "synthesize an actual ISO from a container rootfs") then b-i-b can clearly do the latter phase without involving dnf.

cgwalters avatar May 02 '25 12:05 cgwalters

@cgwalters Yes, that'd be correct though there's more than one filesystem involved with different trees, if I recall correctly.

supakeen avatar May 02 '25 16:05 supakeen

https://github.com/osbuild/images/pull/1906 implemented the first step towards making it possible to build ISOs directly from bootc container images, without the need to fetch and install RPMs.

We'll close this issue once we finalise it and it available in bootc-image-builder.

achilleas-k avatar Nov 11 '25 10:11 achilleas-k