pub struct ContainerRunSpec {
pub name: String,
pub image: String,
pub label: String,
pub ports: Vec<(u16, u16)>,
pub env: BTreeMap<String, String>,
pub volumes: Vec<(PathBuf, String)>,
pub cmd: Vec<String>,
pub cap_add: Vec<String>,
pub cgroupns: Option<String>,
pub network: Option<String>,
pub network_aliases: Vec<String>,
pub extra_hosts: Vec<String>,
}Expand description
Run-time spec for a single container managed by LocalRuntime::run.
Fields§
§name: StringCanonical name — see canonical_name.
image: StringImage ref. Tag-pinned for cache determinism (caddy:2.10-alpine).
label: StringValue for the yah.local-sim label (see canonical_label).
ports: Vec<(u16, u16)>Host→container port bindings.
env: BTreeMap<String, String>Container env vars.
volumes: Vec<(PathBuf, String)>Bind-mount pairs (host_path, container_path).
cmd: Vec<String>Optional CMD override; empty leaves the image default.
cap_add: Vec<String>Linux capabilities to add via --cap-add (e.g. ["SYS_ADMIN"]).
Empty by default; the pond yubaba-container path (R408-T2) sets this
so Kamaji can perform cgroup ops inside the container.
cgroupns: Option<String>Cgroup namespace mode forwarded to docker run --cgroupns=.... Valid
values are "private" and "host"; None leaves the daemon default.
The pond yubaba-container path (R408-T2) sets "private" so the
container sees a fresh /sys/fs/cgroup it can write child cgroups
under.
network: Option<String>Docker network to attach the container to via --network <name>.
None leaves the daemon default (the bridge network). The pond
per-cell bridge (R455-F1) sets this to pond_network_name.
network_aliases: Vec<String>Network aliases registered with --network-alias <alias> so siblings
on the same bridge can reach this container by name regardless of its
container name. Ignored when [network] is None.
extra_hosts: Vec<String>Extra /etc/hosts entries forwarded as --add-host <entry> (e.g.
host.docker.internal:host-gateway). The pond yubaba-container
(R408-T2) uses this so probes against host-published ports resolve on
Linux docker, where host.docker.internal is not provided by default
(OrbStack and Docker Desktop define it natively; the redundant
mapping is harmless there).
Implementations§
Source§impl ContainerRunSpec
impl ContainerRunSpec
Sourcepub fn new(
service: &str,
env: &str,
slot: &str,
image: impl Into<String>,
) -> Self
pub fn new( service: &str, env: &str, slot: &str, image: impl Into<String>, ) -> Self
Convenience: build a spec with the canonical name + label derived from the (service, env, slot) triple.
Sourcepub fn docker_run_args(&self) -> Vec<String>
pub fn docker_run_args(&self) -> Vec<String>
Build the full docker run … argv emitted by LocalRuntime::run.
Pure helper so callers (and tests) can inspect the wiring without a
live docker socket.
Trait Implementations§
Source§impl Clone for ContainerRunSpec
impl Clone for ContainerRunSpec
Source§fn clone(&self) -> ContainerRunSpec
fn clone(&self) -> ContainerRunSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more