feat: Add bootc support (#448)

Adds support for using `bootc` as the preferred method for booting from
a locally created image. This new method gets rid of the need to create
a tarball and move it to the correct place and instead it will make use
of `podman scp` which copies the image to the root `containers-storage`
and then has `rpm-ostree` and `bootc` boot from that store.

Closes #418 
Closes #200
This commit is contained in:
Gerald Pinder 2025-08-09 14:05:59 -04:00 committed by GitHub
parent 2c525854c9
commit 3a0be4099a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 2991 additions and 1857 deletions

View file

@ -12,6 +12,7 @@ license.workspace = true
askama = { version = "0.14", features = ["serde_json"] }
blue-build-recipe = { version = "=0.9.22", path = "../recipe" }
blue-build-utils = { version = "=0.9.22", path = "../utils" }
oci-distribution.workspace = true
chrono.workspace = true
log.workspace = true

View file

@ -9,28 +9,29 @@ use bon::Builder;
use chrono::Utc;
use colored::control::ShouldColorize;
use log::{debug, error, trace, warn};
use oci_distribution::Reference;
use uuid::Uuid;
pub use askama::Template;
#[derive(Debug, Clone, Template, Builder)]
#[template(path = "Containerfile.j2", escape = "none", whitespace = "minimize")]
#[builder(on(Cow<'_, str>, into))]
pub struct ContainerFileTemplate<'a> {
#[builder(into)]
recipe: &'a Recipe<'a>,
#[builder(into)]
recipe_path: Cow<'a, Path>,
recipe_path: &'a Path,
#[builder(into)]
build_id: Uuid,
os_version: u64,
registry: Cow<'a, str>,
build_scripts_image: Cow<'a, str>,
repo: Cow<'a, str>,
base_digest: Cow<'a, str>,
registry: &'a str,
build_scripts_image: &'a Reference,
repo: &'a str,
base_digest: &'a str,
nushell_version: Option<&'a MaybeVersion>,
#[builder(default)]
build_features: &'a [String],
}
impl ContainerFileTemplate<'_> {
@ -47,6 +48,15 @@ impl ContainerFileTemplate<'_> {
Some(MaybeVersion::Version(version)) => version.to_string(),
}
}
#[must_use]
fn get_features(&self) -> String {
self.build_features
.iter()
.map(|feat| feat.trim())
.collect::<Vec<_>>()
.join(",")
}
}
#[derive(Debug, Clone, Template, Builder)]

View file

@ -7,6 +7,7 @@ FROM {{ recipe.base_image }}@{{ base_digest }} AS {{ main_stage }}
ARG RECIPE={{ recipe_path.display() }}
ARG IMAGE_REGISTRY={{ registry }}
ARG BB_BUILD_FEATURES="{{ get_features() }}"
{%- if self::config_dir_exists() && !self::files_dir_exists() %}
ARG CONFIG_DIRECTORY="/tmp/config"