MCPcopy Create free account
hub / github.com/bootc-dev/bootc / export

Function export

crates/lib/src/container_export.rs:30–51  ·  view source on GitHub ↗
(
    format: &ExportFormat,
    target_path: &Utf8Path,
    output_path: Option<&Utf8Path>,
    kernel_in_boot: bool,
    disable_selinux: bool,
)

Source from the content-addressed store, hash-verified

28/// Export a container filesystem to tar format with bootc-specific features.
29#[context("Exporting container")]
30pub(crate) async fn export(
31 format: &ExportFormat,
32 target_path: &Utf8Path,
33 output_path: Option<&Utf8Path>,
34 kernel_in_boot: bool,
35 disable_selinux: bool,
36) -> Result<()> {
37 use cap_std_ext::cap_std;
38 use cap_std_ext::cap_std::fs::Dir;
39
40 let options = ExportOptions {
41 kernel_in_boot,
42 disable_selinux,
43 };
44
45 let root_dir = Dir::open_ambient_dir(target_path, cap_std::ambient_authority())
46 .with_context(|| format!("Failed to open directory: {}", target_path))?;
47
48 match format {
49 ExportFormat::Tar => export_tar(&root_dir, output_path, &options).await,
50 }
51}
52
53/// Export container filesystem as tar archive.
54#[context("Exporting to tar")]

Callers 3

push_entrypointFunction · 0.70
set_unifiedFunction · 0.70
run_from_optFunction · 0.70

Calls 1

export_tarFunction · 0.85

Tested by

no test coverage detected