pub struct BuildOptions {Show 20 fields
pub dockerfile: Option<PathBuf>,
pub zimagefile: Option<PathBuf>,
pub runtime: Option<Runtime>,
pub build_args: HashMap<String, String>,
pub target: Option<String>,
pub tags: Vec<String>,
pub no_cache: bool,
pub push: bool,
pub registry_auth: Option<RegistryAuth>,
pub squash: bool,
pub format: Option<String>,
pub layers: bool,
pub cache_from: Option<String>,
pub cache_to: Option<String>,
pub cache_ttl: Option<Duration>,
pub default_registry: Option<String>,
pub default_cache_mounts: Vec<RunMount>,
pub retries: u32,
pub platform: Option<String>,
pub source_hash: Option<String>,
}Expand description
Build options for customizing the image build process
Fields§
§dockerfile: Option<PathBuf>Dockerfile path (default: Dockerfile in context)
zimagefile: Option<PathBuf>ZImagefile path (alternative to Dockerfile)
runtime: Option<Runtime>Use runtime template instead of Dockerfile
build_args: HashMap<String, String>Build arguments (ARG values)
target: Option<String>Target stage for multi-stage builds
Image tags to apply
no_cache: boolDisable layer caching
push: boolPush to registry after build
registry_auth: Option<RegistryAuth>Registry auth (if pushing)
squash: boolSquash all layers into one
format: Option<String>Image format (oci or docker)
layers: boolEnable buildah layer caching (–layers flag for buildah build).
Default: true
Note: ZLayer uses manual container creation (buildah from, buildah run,
buildah commit) rather than buildah build, so this flag is reserved
for future use when/if we switch to buildah build (bud) command.
cache_from: Option<String>Registry to pull cache from (–cache-from for buildah build).
Note: This would be used with buildah build --cache-from=<registry>.
Currently ZLayer uses manual container creation, so this is reserved
for future implementation or for switching to buildah build.
TODO: Implement remote cache support. This would require either:
- Switching to
buildah buildcommand which supports –cache-from natively - Implementing custom layer caching with registry push/pull for intermediate layers
cache_to: Option<String>Registry to push cache to (–cache-to for buildah build).
Note: This would be used with buildah build --cache-to=<registry>.
Currently ZLayer uses manual container creation, so this is reserved
for future implementation or for switching to buildah build.
TODO: Implement remote cache support. This would require either:
- Switching to
buildah buildcommand which supports –cache-to natively - Implementing custom layer caching with registry push/pull for intermediate layers
cache_ttl: Option<Duration>Maximum cache age (–cache-ttl for buildah build).
Note: This would be used with buildah build --cache-ttl=<duration>.
Currently ZLayer uses manual container creation, so this is reserved
for future implementation or for switching to buildah build.
TODO: Implement cache TTL support. This would require either:
- Switching to
buildah buildcommand which supports –cache-ttl natively - Implementing custom cache expiration logic for our layer caching system
default_registry: Option<String>Default OCI/WASM-compatible registry to check for images before falling back to Docker Hub qualification.
When set, the builder will probe this registry for short image names
before qualifying them to docker.io. For example, if set to
"git.example.com:5000" and the ZImagefile uses base: "myapp:latest",
the builder will check git.example.com:5000/myapp:latest first.
default_cache_mounts: Vec<RunMount>Default cache mounts injected into all RUN instructions. These are merged with any step-level cache mounts (deduped by target path).
retries: u32Number of retries for failed RUN steps (0 = no retries, default)
platform: Option<String>Target platform for the build (e.g., “linux/amd64”, “linux/arm64”).
When set, buildah from pulls the platform-specific image variant.
source_hash: Option<String>SHA-256 hash of the source Dockerfile/ZImagefile content.
When set, the sandbox builder can skip a rebuild if the cached image was produced from identical source content (content-based invalidation).
Trait Implementations§
Source§impl Clone for BuildOptions
impl Clone for BuildOptions
Source§fn clone(&self) -> BuildOptions
fn clone(&self) -> BuildOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildOptions
impl Debug for BuildOptions
Auto Trait Implementations§
impl Freeze for BuildOptions
impl RefUnwindSafe for BuildOptions
impl Send for BuildOptions
impl Sync for BuildOptions
impl Unpin for BuildOptions
impl UnsafeUnpin for BuildOptions
impl UnwindSafe for BuildOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more