pub trait BuildBackend: Send + Sync {
// Required methods
fn build_image<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 Path,
dockerfile: &'life2 Dockerfile,
options: &'life3 BuildOptions,
event_tx: Option<Sender<BuildEvent>>,
) -> Pin<Box<dyn Future<Output = Result<BuiltImage>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn push_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
auth: Option<&'life2 RegistryAuth>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn tag_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
image: &'life1 str,
new_tag: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn manifest_create<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn manifest_add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
manifest: &'life1 str,
image: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn manifest_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
destination: &'life2 str,
auth: Option<&'life3 RegistryAuth>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &'static str;
// Provided method
fn export_oci_archive<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
dest: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
A pluggable build backend.
Implementations handle the low-level mechanics of building, pushing, tagging, and managing manifest lists for container images.
Required Methods§
Sourcefn build_image<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 Path,
dockerfile: &'life2 Dockerfile,
options: &'life3 BuildOptions,
event_tx: Option<Sender<BuildEvent>>,
) -> Pin<Box<dyn Future<Output = Result<BuiltImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn build_image<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 Path,
dockerfile: &'life2 Dockerfile,
options: &'life3 BuildOptions,
event_tx: Option<Sender<BuildEvent>>,
) -> Pin<Box<dyn Future<Output = Result<BuiltImage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Build a container image from a parsed Dockerfile.
§Arguments
context— path to the build context directorydockerfile— parsed Dockerfile IRoptions— build configuration (tags, args, caching, etc.)event_tx— optional channel for streaming progress events to a TUI
Sourcefn push_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
auth: Option<&'life2 RegistryAuth>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn push_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
auth: Option<&'life2 RegistryAuth>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Push an image to a container registry.
Sourcefn tag_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
image: &'life1 str,
new_tag: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn tag_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
image: &'life1 str,
new_tag: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Tag an existing image with a new name.
Sourcefn manifest_create<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn manifest_create<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new (empty) manifest list.
Sourcefn manifest_add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
manifest: &'life1 str,
image: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn manifest_add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
manifest: &'life1 str,
image: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Add an image to an existing manifest list.
Sourcefn manifest_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
destination: &'life2 str,
auth: Option<&'life3 RegistryAuth>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn manifest_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
destination: &'life2 str,
auth: Option<&'life3 RegistryAuth>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Push a manifest list (and all referenced images) to a registry.
auth carries optional registry credentials (mirrors Self::push_image);
when Some, they authenticate the manifest-list push.
Provided Methods§
Sourcefn export_oci_archive<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
dest: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn export_oci_archive<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tag: &'life1 str,
dest: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Export the built image tag to an OCI image-layout archive (tar) at
dest, in the format [zlayer_registry::import_image] consumes
(oci-layout + index.json + blobs/sha256/*).
Returns true if the backend performed the export natively; false if it
has no native export and the caller should fall back to its buildah-based
buildah push … oci-archive: path. This is backend-owned so a non-buildah
backend — the macOS Seatbelt [SandboxBackend] — can populate the local
registry with no buildah binary on the host. The default declines
(Ok(false)), preserving the buildah export for backends that wrap a real
buildah executor.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".