Skip to main content

Module backend

Module backend 

Source
Expand description

Build backend abstraction.

Provides a unified BuildBackend trait that decouples the build orchestration logic from the underlying container tooling. Platform-specific implementations are selected at runtime via detect_backend.

§Backends

  • BuildahBackend — wraps the buildah CLI (Linux + macOS with buildah installed).
  • SandboxBackend (macOS-only) — uses the Seatbelt sandbox when buildah is unavailable.
  • HcsBackend (Windows-only, see [hcs]) — native Windows builder via HCS; wraps zlayer_agent::windows::{scratch, layer} to produce OCI images without Docker Desktop.

§Target OS routing

The ImageOs enum selects which image OS we are building for (Linux or Windows). detect_backend branches on both the host OS and the target OS: Windows images can only be built on a Windows host (via the HCS-backed backend that landed in Phase L-4), while Linux images on Windows hosts currently require a Linux peer (a WSL2-buildah route is a Phase L follow-up).

Structs§

BuildahBackend
Build backend that delegates to the buildah CLI.
ImageOsParseError
Error returned when parsing an unknown ImageOs string.

Enums§

ImageOs
Operating system of the image being built.

Traits§

BuildBackend
A pluggable build backend.

Functions§

detect_backend
Auto-detect the best available build backend for the given target OS.