Skip to content

[Feature]: Replace golden image build with osbuild blueprint #91

Description

@mrhillsman

Problem Statement

The current golden container disk image build (build/golden-image/Containerfile) uses FROM quay.io/containerdisks/fedora:41 and runs RUN dnf install to pre-install workload packages. This fails because KubeVirt containerdisk images are minimal OCI wrappers around a qcow2 disk image — they do not have a regular root filesystem with a package manager.

Developers cannot build the golden image, and there is no declarative way to manage the package list for the image.

Proposed Solution

Replace the Containerfile-based build with an osbuild workflow using the image-builder CLI and a TOML blueprint.

Workflow:

  1. A blueprint.toml file declaratively lists all packages to install (stress-ng, fio, iperf3, postgresql-server, iproute-tc, iptables-nft, kernel-modules-extra, netperf, python3, cloud-init, qemu-guest-agent).
  2. image-builder build qcow2 --distro fedora-41 --blueprint blueprint.toml produces a real Fedora 41 qcow2 disk image with all packages baked in.
  3. A minimal FROM scratch Containerfile packages the qcow2 into a KubeVirt-compatible containerdisk OCI image.

Files to change (all under build/golden-image/):

  • Create blueprint.toml — osbuild TOML blueprint with all workload packages
  • Rewrite build.sh — two-stage build: image-builder build then podman build
  • Rewrite Containerfile — minimal FROM scratch + COPY qcow2 /disk/
  • Rewrite README.md — document prerequisites, workflow, and how to add packages

Benefits:

  • Declarative, version-controlled package manifest (edit TOML to add packages)
  • osbuild validates packages exist at build time — fast failure on typos or missing packages
  • No daemon required (image-builder CLI runs standalone, unlike osbuild-composer)
  • Developers have a clear pathway to add packages for custom workloads
  • Aligns with Fedora/Red Hat image-based Linux tooling direction

Prerequisites for builders:

  • image-builder package (dnf install image-builder on Fedora)
  • podman (already required)

Alternatives Considered

  1. virt-customize — Download the Fedora Cloud qcow2, run virt-customize --install ..., package as containerdisk. Simpler but imperative (shell script, not declarative). No structured way for developers to manage the package list. Requires libguestfs-tools.

  2. bootc (boot containers) — Build a bootc container image with packages, convert to qcow2 via bootc-image-builder, package as containerdisk. Works but: requires bootc-image-builder as an extra dependency, produces ostree-based images (larger, read-only rootfs adds complexity), and the two-stage build is more complex than osbuild.

Additional Context

  • The image-builder package (v65) is available in Fedora repos and wraps osbuild without requiring a daemon.
  • The qcow2 image type from osbuild for Fedora includes cloud-init, qemu-guest-agent, chrony, and kernel by default.
  • The existing env var interface (REGISTRY, IMAGE_NAME, TAG, PUSH) and usage patterns (CLI flag --container-disk-image, env var VIRTWORK_CONTAINER_DISK_IMAGE, config key container_disk_image) remain unchanged.
  • Blueprint reference: https://osbuild.org/docs/user-guide/blueprint-reference/
  • CLI docs: https://osbuild.org/docs/on-premises/commandline/

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.size/MDenotes a PR that changes 30-99 lines, ignoring generated files.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions