pub struct ContainerInfo {
pub id: String,
pub name: Option<String>,
pub image: String,
pub state: String,
pub labels: HashMap<String, String>,
pub created_at: String,
pub pid: Option<u32>,
pub ports: Vec<PortMapping>,
pub networks: Vec<NetworkAttachmentInfo>,
pub ipv4: Option<String>,
pub health: Option<ContainerHealthInfo>,
pub exit_code: Option<i32>,
}Expand description
Container information returned by the API
Fields§
§id: StringContainer identifier
name: Option<String>Human-readable name (if set)
image: StringOCI image reference
state: StringContainer state (pending, running, exited, failed)
labels: HashMap<String, String>Labels
created_at: StringCreation timestamp (ISO 8601)
pid: Option<u32>Process ID (if running)
ports: Vec<PortMapping>Published port mappings (container → host). Populated from the runtime’s inspect response; empty when the runtime doesn’t expose port-level detail or the container has no published ports.
networks: Vec<NetworkAttachmentInfo>Networks this container is attached to, with per-network aliases and IPv4. Empty when the runtime doesn’t surface network detail.
ipv4: Option<String>Primary IPv4 address (first non-empty IP across attached networks).
Docker’s bridge network is preferred when present.
health: Option<ContainerHealthInfo>Runtime-native health status, when the container image declares a
HEALTHCHECK (or equivalent). None when the runtime doesn’t track
health for this container.
exit_code: Option<i32>Most-recent exit code. None for containers still running and for
containers that have never exited.