pub struct ZImage {Show 19 fields
pub version: Option<String>,
pub runtime: Option<String>,
pub base: Option<String>,
pub build: Option<ZBuildContext>,
pub steps: Vec<ZStep>,
pub platform: Option<String>,
pub stages: Option<IndexMap<String, ZStage>>,
pub wasm: Option<ZWasmConfig>,
pub env: HashMap<String, String>,
pub workdir: Option<String>,
pub expose: Option<ZExpose>,
pub cmd: Option<ZCommand>,
pub entrypoint: Option<ZCommand>,
pub user: Option<String>,
pub labels: HashMap<String, String>,
pub volumes: Vec<String>,
pub healthcheck: Option<ZHealthcheck>,
pub stopsignal: Option<String>,
pub args: HashMap<String, String>,
}Expand description
Top-level ZImagefile representation.
Exactly one of the four mode fields must be set:
runtimefor runtime template shorthandbase+stepsfor single-stage buildsstagesfor multi-stage buildswasmfor WebAssembly component builds
Common image metadata fields (env, workdir, expose, cmd, etc.) apply to the final output image regardless of mode.
Fields§
§version: Option<String>ZImagefile format version (currently must be “1”)
runtime: Option<String>Runtime template name, e.g. “node22”, “python313”, “rust”
base: Option<String>Base image for single-stage builds (e.g. “alpine:3.19”).
Mutually exclusive with build.
build: Option<ZBuildContext>Build a base image from a local Dockerfile/ZImagefile context.
Mutually exclusive with base.
steps: Vec<ZStep>Build steps for single-stage mode
platform: Option<String>Target platform for single-stage mode (e.g. “linux/amd64”)
stages: Option<IndexMap<String, ZStage>>Named stages for multi-stage builds. Insertion order is preserved; the last stage is the output image.
wasm: Option<ZWasmConfig>WebAssembly build configuration
env: HashMap<String, String>Environment variables applied to the final image
workdir: Option<String>Working directory for the final image
expose: Option<ZExpose>Ports to expose
cmd: Option<ZCommand>Default command (CMD equivalent)
entrypoint: Option<ZCommand>Entrypoint command
user: Option<String>User to run as in the final image
labels: HashMap<String, String>Image labels / metadata
volumes: Vec<String>Volume mount points
healthcheck: Option<ZHealthcheck>Healthcheck configuration
stopsignal: Option<String>Signal to send when stopping the container
args: HashMap<String, String>Build arguments (name -> default value)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ZImage
impl<'de> Deserialize<'de> for ZImage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ZImage
impl RefUnwindSafe for ZImage
impl Send for ZImage
impl Sync for ZImage
impl Unpin for ZImage
impl UnsafeUnpin for ZImage
impl UnwindSafe for ZImage
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