Skip to content

Build disk images using bootc-image-builder #1906

@jlebon

Description

@jlebon

bootc-image-builder (b-i-b) can be used today to build disk images from bootable containers. coreos-assembler (and the not-officially-supported https://github.com/coreos/custom-coreos-disk-images) can be used to build custom disk images from CoreOS bootable containers.

We want to centralize on b-i-b as the one tool to build disk images from bootable containers.

Both use osbuild, but differently. b-i-b uses image definitions in https://github.com/osbuild/images which get converted to osbuild manifests, while cosa has osbuild-mpp manifests that get converted to osbuild manifests.

b-i-b must run as root. cosa can run as non-root but requires /dev/kvm.

We already ship image.json today and platforms.json which means that the container image fully describes disk image construction.

Likely missing steps and important details here, but roughly for this I think we need to:

  1. Do Use bootc install to-filesystem to build our bootimages #1827 to drain logic from our manifests and be consistent with the rest of Image Mode.
  2. Add/rewrite our manifests to osbuild/images.
  3. Upstream the info in platforms.json to somewhere (also osbuild/images?) where it can be shared by all disk image builds since it's not really CoreOS specific.
  4. Add support for all the platforms we need in the b-i-b CLI to build from the osbuild/images definitions. Ideally there's nothing CoreOS specific in these build targets... except probably the CoreOS live ISO. I think a challenge there is that (1) b-i-b mixes cloud uploading with artifact building, and (2) b-i-b doesn't distinguish cleanly between disk format and target platform. E.g. we have a bunch of platforms that use qcow2, but they're all distinct (by virtue of the ignition.platform.id karg). One approach could be to add e.g. qemu-qcow2, openstack-qcow2, etc... and those all in effect give identical results when fed a non-CoreOS bootable container (so really, almost like an alias for qcow2), but for CoreOS we have metadata in the image that makes it inject e.g. the right Ignition kargs.
  5. Make cosa use b-i-b. We want to ensure that the exact same tooling is used to build the official disk images as for custom disk images. This also allows us to paper over the root requirement I think, but ideally we should reopen the conversation in upstream b-i-b to support that directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions