This project provides a testing framework for KVM image mode using container-based builds and disk image generation. It leverages two Containerfiles—one for the host and one for the guest—along with a configuration file for the bootc-image-builder tool to produce qcow2/raw disk images.
-
Containerfile.host This file is used to build the host image. It accepts the following build arguments:
STREAM: The major release version of CentOS (e.g., stream9, stream10)
-
Containerfile.guest This file is used to build the guest image and utilizes the same build arguments as the host image.
-
config.toml A TOML configuration file used by the
bootc-image-buildertool. This file customizes the resulting disk image (qcow2 or raw) by allowing you to specify parameters such as user settings and other customizations.
- buildah installed on your system.
- The
bootc-image-buildertool (typically run as a container) to convert your container images into disk images.
The repository includes two Containerfiles—one for the host and one for the guest. Both require the build arguments to tailor the image for a specific CentOS Stream release and compose.
buildah bud \
--build-arg STREAM=<stream_version> \
-f Containerfile.host \
-t kvm-bootc-host .buildah bud \
--build-arg STREAM=<stream_version> \
-f Containerfile.guest \
-t kvm-bootc-guest .The config.toml file in this repository configures the disk image build process. Use the bootc-image-builder container to generate a qcow2 (or raw) disk image from one of your built container images.
Example command:
podman run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v /var/lib/containers/storage:/var/lib/containers/storage \
-v $(pwd)/config.toml:/config.toml:ro \
-v $(pwd)/output:/output \
quay.io/centos-bootc/bootc-image-builder:latest \
--type qcow2 \
localhost/kvm-bootc-guest:latestThis command mounts the configuration file and an output directory into the builder container. Adjust the image reference (localhost/kvm-bootc-guest:latest) as needed.
- Configuration Management: As the project evolves, consider expanding the
config.tomlfile to include more detailed customizations (e.g., additional user settings, kernel parameters, or custom scripts). - Multi-Platform Support: While this README covers qcow2 image generation, you might also want to include instructions for generating other image types (e.g., raw, ISO) if needed.
- Automation: Look into integrating these build and test commands into CI/CD pipelines to automate testing across different configurations and image types.
Contributions are welcome! If you have ideas for new features, improvements to the build process, or additional testing strategies, please open an issue or submit a merge request.