Add qcow2 support
CI / build (push) Successful in 13s

This commit is contained in:
2026-08-30 17:08:08 +02:00
parent 46a86116b0
commit 286def05c1
7 changed files with 303 additions and 50 deletions
+6 -10
View File
@@ -1,12 +1,14 @@
mod build;
mod command;
mod image;
mod meta;
mod qemu;
mod registry;
use anyhow::Result;
use clap::{Parser, Subcommand};
use crate::{image::ImageCmd, qemu::RunCmd};
use crate::{build::BuildCmd, image::ImageCmd, qemu::RunCmd};
#[derive(Parser, Debug)]
#[command(about = "Build bootable initrd VMs from container images")]
@@ -18,13 +20,7 @@ struct Cli {
#[derive(Subcommand, Debug)]
enum Commands {
/// Build initrd from an image (podman image must exist)
Build {
/// Image name (e.g. alpine:3.15 or slim:tag)
image: String,
/// Size hint (unused in v1 initrd)
#[arg(short = 's', long, default_value = "512")]
_size: String,
},
Build(BuildCmd),
/// Launch a previously built VM via QEMU.
Run(RunCmd),
/// List slim images in the registry
@@ -35,8 +31,8 @@ enum Commands {
fn main() -> Result<()> {
let cli = Cli::parse();
match cli.command {
Commands::Build { image, _size: _ } => {
build::build(&image)?;
Commands::Build(cmd) => {
build::build(cmd)?;
}
Commands::Run(cmd) => {
qemu::run(cmd)?;