pub struct ImageConfig {
pub entrypoint: Option<Vec<String>>,
pub cmd: Option<Vec<String>>,
pub working_dir: Option<String>,
pub env: Option<Vec<String>>,
pub user: Option<String>,
pub exposed_ports: Option<HashMap<String, Value>>,
pub volumes: Option<HashMap<String, Value>>,
pub labels: Option<HashMap<String, String>>,
pub stop_signal: Option<String>,
pub shell: Option<Vec<String>>,
pub healthcheck: Option<ImageHealthcheck>,
}Expand description
Container runtime configuration extracted from an OCI image config blob.
This represents the config object inside the OCI image configuration JSON.
Fields map to the corresponding Docker/OCI image config spec fields.
Fields§
§entrypoint: Option<Vec<String>>The entrypoint for the container (e.g., ["/usr/bin/myapp"]).
When both entrypoint and cmd are set, cmd provides default
arguments to the entrypoint.
cmd: Option<Vec<String>>The default command for the container (e.g., ["--port", "8080"]).
If entrypoint is also set, cmd provides default arguments.
If entrypoint is not set, cmd is the full command to run.
working_dir: Option<String>The working directory for the container process.
env: Option<Vec<String>>Environment variables in KEY=VALUE format.
user: Option<String>The user (and optionally group) to run the container process as.
Format: "user", "user:group", "uid", or "uid:gid".
exposed_ports: Option<HashMap<String, Value>>Ports exposed by the container. Keys are in "port/protocol" format
(e.g., "8080/tcp"). Values are empty objects.
volumes: Option<HashMap<String, Value>>Volumes defined by the image. Keys are mount paths, values are empty objects.
labels: Option<HashMap<String, String>>Arbitrary metadata labels.
stop_signal: Option<String>Signal to send to the container to stop it (e.g., "SIGTERM").
shell: Option<Vec<String>>Custom shell for RUN instructions (SHELL instruction).
Format: ["/bin/bash", "-c"].
healthcheck: Option<ImageHealthcheck>Healthcheck configuration.
Implementations§
Source§impl ImageConfig
impl ImageConfig
Sourcepub fn full_command(&self) -> Option<Vec<String>>
pub fn full_command(&self) -> Option<Vec<String>>
Build the full command line by combining entrypoint and cmd.
Follows Docker/OCI semantics:
- If entrypoint is set, it is the executable and cmd provides default args
- If only cmd is set, it is the full command
- If neither is set, returns None