Skip to content

YvanY0/kvm-bootc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kvm-bootc

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.

Repository Contents

  • 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-builder tool. This file customizes the resulting disk image (qcow2 or raw) by allowing you to specify parameters such as user settings and other customizations.

Getting Started

Prerequisites

  • buildah installed on your system.
  • The bootc-image-builder tool (typically run as a container) to convert your container images into disk images.

Building Container 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.

Host Image Build

buildah bud \
  --build-arg STREAM=<stream_version> \
  -f Containerfile.host \
  -t kvm-bootc-host .

Guest Image Build

buildah bud \
  --build-arg STREAM=<stream_version> \
  -f Containerfile.guest \
  -t kvm-bootc-guest .

Building Disk Images with bootc-image-builder

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:latest

This command mounts the configuration file and an output directory into the builder container. Adjust the image reference (localhost/kvm-bootc-guest:latest) as needed.

Forward-Thinking Considerations

  • Configuration Management: As the project evolves, consider expanding the config.toml file 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.

Contributing

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.

About

Containerfile to create host and guest kvm bootc images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors