pub struct ContainerSpec {
pub name: String,
pub image: String,
pub env: Vec<(String, String)>,
pub command: Option<Vec<String>>,
pub ports: Vec<PortBinding>,
pub mounts: Vec<FileMount>,
pub network_id: Option<String>,
pub aliases: Vec<String>,
pub run_id: String,
pub memory_limit_mb: Option<u64>,
}Expand description
Everything a backend needs to create one container. Host ports in ports are
already chosen by the core allocator (see free_ports) — a backend binds them,
it never allocates, so the same spec works identically whether the backend is a
microVM or a Docker daemon.
Fields§
§name: StringThe backend-facing container name, e.g. rz-<run_id>-<seq>.
image: StringThe image reference to run.
env: Vec<(String, String)>Environment variables, insertion-ordered — a Vec of pairs rather than a
HashMap so order and duplicate-key handling stay under the caller’s control.
command: Option<Vec<String>>The command to run instead of the image’s default entrypoint. None means “run
the image as built.”
ports: Vec<PortBinding>Already-chosen host↔guest port bindings — see the type-level doc.
mounts: Vec<FileMount>Host files/directories to mount into the guest.
network_id: Option<String>The network to join, if any.
aliases: Vec<String>DNS-style aliases this container is reachable as by other members of its network.
run_id: StringThe per-process run id (see run_id), used to label/name containers so a crashed
run’s leftovers can be told apart from a live run’s.
memory_limit_mb: Option<u64>An optional memory cap in megabytes.
Implementations§
Trait Implementations§
Source§impl Clone for ContainerSpec
impl Clone for ContainerSpec
Source§fn clone(&self) -> ContainerSpec
fn clone(&self) -> ContainerSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more