ContainerInfo Class

A snapshot of a container's state, obtained from an inspect operation.

public sealed class ContainerInfo : IEquatable<ContainerInfo>
Implements

Constructors

NameDescription
ContainerInfo()

ContainerInfo()

ContainerInfo.cs
  • Obsolete: Constructors of types with required members are not supported in this version of your compiler.
[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
public ContainerInfo()

No documentation is available.

Properties

NameDescription
ExitCodeGets the exit code of the container, when it has exited.
FinishedAtGets the time the container last exited, when available.
HealthGets the status of the health check of the container (the HEALTHCHECK instruction of its image), or ContainerHealthStatus.None when it has none or the runtime does not report it.
IPAddressGets the container IP address on its primary network, when available.
IdGets the container id.
ImageGets the image the container was created from.
LabelsGets the container labels.
NameGets the container name.
PortsGets the published ports, mapping each container port to its host port.
StartedAtGets the time the container was last started, when available.
StateGets the container state.
StatusGets the raw status string reported by the runtime.

Gets the exit code of the container, when it has exited.

public int? ExitCode { get; init; }

Property value

int?

Gets the time the container last exited, when available.

public DateTimeOffset? FinishedAt { get; init; }

Property value

DateTimeOffset?

Gets the status of the health check of the container (the HEALTHCHECK instruction of its image), or ContainerHealthStatus.None when it has none or the runtime does not report it.

public ContainerHealthStatus Health { get; init; }

Property value

ContainerHealthStatus

Gets the container IP address on its primary network, when available.

public string? IPAddress { get; init; }

Property value

string?

Gets the container id.

public required string Id { get; init; }

Property value

string

Gets the image the container was created from.

public string? Image { get; init; }

Property value

string?

Gets the container labels.

public IReadOnlyDictionary<string, string> Labels { get; init; }

Gets the container name.

public required string Name { get; init; }

Property value

string

Gets the published ports, mapping each container port to its host port.

public IReadOnlyDictionary<int, int> Ports { get; init; }

Gets the time the container was last started, when available.

public DateTimeOffset? StartedAt { get; init; }

Property value

DateTimeOffset?

Gets the container state.

public ContainerState State { get; init; }

Property value

ContainerState

Gets the raw status string reported by the runtime.

public string? Status { get; init; }

Property value

string?

Methods

NameDescription
Equals(ContainerInfo?)
Equals(object?)
GetHashCode()
ToString()

Equals overloads

Equals(ContainerInfo?)

public bool Equals(ContainerInfo? other)
Parameters
other ContainerInfo?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(ContainerInfo?, ContainerInfo?)
operator !=(ContainerInfo?, ContainerInfo?)

operator ==(ContainerInfo?, ContainerInfo?)

public static bool operator ==(ContainerInfo? left, ContainerInfo? right)

Parameters

left ContainerInfo?
right ContainerInfo?

Returns

bool

No documentation is available.

operator !=(ContainerInfo?, ContainerInfo?)

public static bool operator !=(ContainerInfo? left, ContainerInfo? right)

Parameters

left ContainerInfo?
right ContainerInfo?

Returns

bool

No documentation is available.