DockerSdk
the .NET SDK for Docker
Properties | List of all members
DockerSdk.Containers.IContainerInfo Interface Reference

Holds detailed information about a Docker container. More...

Inheritance diagram for DockerSdk.Containers.IContainerInfo:
DockerSdk.Containers.IContainer

Properties

DateTimeOffset CreationTime [get]
 Gets the timestamp for when the container was created. More...
 
string? ErrorMessage [get]
 Gets an error message for why the container exited. Not all exited containers will have this set. More...
 
string Executable [get]
 Gets the main executable that the container runs. This is what MainProcessId points to. More...
 
IReadOnlyList< string > ExecutableArgs [get]
 Gets the arguments to the main executable that the container runs. More...
 
long? ExitCode [get]
 Gets the exit code of the main process. This property is non-null for containers in the Exited state, and null in all other states. More...
 
IImage Image [get]
 Gets the Docker image that the container was created from. More...
 
bool IsPaused [get]
 Gets a value indicating whether the container was in the "paused" state when the query was performed. More...
 
bool IsRunning [get]
 Gets a value indicating whether the container was in the "running" state when the query was performed. More...
 
bool IsRunningOrPaused [get]
 Gets a value indicating whether the container was in either the "running" or "paused" state when the query was performed. More...
 
IReadOnlyDictionary< string, string > Labels [get]
 Gets the labels and their values that have been applied to the container. More...
 
long? MainProcessId [get]
 Gets the process ID of the container's main process. This property is non-null for containers that are running or paused. and null in all other states. More...
 
ContainerName Name [get]
 Gets the containe's name. More...
 
IReadOnlyList< INetworkEndpointNetworkEndpoints [get]
 Gets a list of network endpoints on the container. A network end-point is the link between a container and a network. More...
 
IReadOnlyDictionary< NetworkName, INetworkEndpointNetworkEndpointsByNetworkName [get]
 Gets a mapping from network names to network endpoints on the container. A network end-point is the link between a container and a network. More...
 
IReadOnlyList< INetworkNetworks [get]
 Gets a list of networks attached to the container. More...
 
NetworkSandbox? NetworkSandbox [get]
 Gets information about the network sandbox. The sandbox is in charge of the network endpoints. More...
 
bool? RanOutOfMemory [get]
 Gets a value indicating whether the container was forcibly shut down by the Docker daemon due to an out-of-memory condition. This property is non-null for containers in the Killed state, and null in all other states. More...
 
DateTimeOffset? StartTime [get]
 Gets the time when the container was most recently started, or null if the container has not been started yet. More...
 
ContainerStatus State [get]
 Gets a value that summarizes the container's overall state at the time of the query. More...
 
DateTimeOffset? StopTime [get]
 Gets the time when the container most recently exited, or null if the container has never exited. More...
 
- Properties inherited from DockerSdk.Containers.IContainer
ContainerFullId Id [get]
 Gets the container's full ID. More...
 

Additional Inherited Members

- Public Member Functions inherited from DockerSdk.Containers.IContainer
Task AttachNetwork (NetworkReference network, CancellationToken ct=default)
 Attaches a Docker network to the container. More...
 
Task AttachNetwork (NetworkReference network, AttachNetworkOptions options, CancellationToken ct=default)
 Attaches a Docker network to the container. More...
 
Task AttachNetwork (string network, CancellationToken ct=default)
 Attaches a Docker network to the container. More...
 
Task AttachNetwork (string network, AttachNetworkOptions options, CancellationToken ct=default)
 Attaches a Docker network to the container. More...
 
Task< IContainerInfoGetDetailsAsync (CancellationToken ct=default)
 Gets detailed information about the container. More...
 
Task StartAsync (CancellationToken ct=default)
 Starts the container, if it is not already running. More...
 

Detailed Description

Holds detailed information about a Docker container.

This class holds a snapshot in time. Its information is immutable once created.

Property Documentation

◆ CreationTime

DateTimeOffset DockerSdk.Containers.IContainerInfo.CreationTime
get

Gets the timestamp for when the container was created.

◆ ErrorMessage

string? DockerSdk.Containers.IContainerInfo.ErrorMessage
get

Gets an error message for why the container exited. Not all exited containers will have this set.

◆ Executable

string DockerSdk.Containers.IContainerInfo.Executable
get

Gets the main executable that the container runs. This is what MainProcessId points to.

This gives the actual executable run by the main process. Note that ENTRYPOINT/CMD directives in shell format are shorthands for running a shell, so the actual executable in that case will be whatever you specified for the SHELL directive (which defaults to /bin/sh for Linux or cmd for Windows).

See also
ExecutableArgs

◆ ExecutableArgs

IReadOnlyList<string> DockerSdk.Containers.IContainerInfo.ExecutableArgs
get

Gets the arguments to the main executable that the container runs.

This gives the arguments to the actual executable run by the main process. Note that ENTRYPOINT/CMD directives in shell format are shorthands for running a shell, so the text provided to those directives will really be part of the arguments.

See also
Executable

◆ ExitCode

long? DockerSdk.Containers.IContainerInfo.ExitCode
get

Gets the exit code of the main process. This property is non-null for containers in the Exited state, and null in all other states.

◆ Image

IImage DockerSdk.Containers.IContainerInfo.Image
get

Gets the Docker image that the container was created from.

◆ IsPaused

bool DockerSdk.Containers.IContainerInfo.IsPaused
get

Gets a value indicating whether the container was in the "paused" state when the query was performed.

Caution: The container's status might change between when the daemon reads it and when this object is available for reading. Beware of race conditions.

◆ IsRunning

bool DockerSdk.Containers.IContainerInfo.IsRunning
get

Gets a value indicating whether the container was in the "running" state when the query was performed.

Cautions:

  • Unlike the docker container inspect command, this property does not consider paused containers to be "running". Instead, this is equivalent to State == ContainerStatus.Running.
  • The container's status might change between when the daemon reads it and when this object is available for reading. Beware of race conditions.
See also
IsRunningOrPaused, State, ContainerStatus

◆ IsRunningOrPaused

bool DockerSdk.Containers.IContainerInfo.IsRunningOrPaused
get

Gets a value indicating whether the container was in either the "running" or "paused" state when the query was performed.

Caution: The container's status might change between when the daemon reads it and when this object is available for reading. Beware of race conditions.

◆ Labels

IReadOnlyDictionary<string, string> DockerSdk.Containers.IContainerInfo.Labels
get

Gets the labels and their values that have been applied to the container.

◆ MainProcessId

long? DockerSdk.Containers.IContainerInfo.MainProcessId
get

Gets the process ID of the container's main process. This property is non-null for containers that are running or paused. and null in all other states.

The container will automatically exit when this process exits.

◆ Name

ContainerName DockerSdk.Containers.IContainerInfo.Name
get

Gets the containe's name.

◆ NetworkEndpoints

IReadOnlyList<INetworkEndpoint> DockerSdk.Containers.IContainerInfo.NetworkEndpoints
get

Gets a list of network endpoints on the container. A network end-point is the link between a container and a network.

◆ NetworkEndpointsByNetworkName

IReadOnlyDictionary<NetworkName, INetworkEndpoint> DockerSdk.Containers.IContainerInfo.NetworkEndpointsByNetworkName
get

Gets a mapping from network names to network endpoints on the container. A network end-point is the link between a container and a network.

◆ Networks

IReadOnlyList<INetwork> DockerSdk.Containers.IContainerInfo.Networks
get

Gets a list of networks attached to the container.

◆ NetworkSandbox

NetworkSandbox? DockerSdk.Containers.IContainerInfo.NetworkSandbox
get

Gets information about the network sandbox. The sandbox is in charge of the network endpoints.

◆ RanOutOfMemory

bool? DockerSdk.Containers.IContainerInfo.RanOutOfMemory
get

Gets a value indicating whether the container was forcibly shut down by the Docker daemon due to an out-of-memory condition. This property is non-null for containers in the Killed state, and null in all other states.

◆ StartTime

DateTimeOffset? DockerSdk.Containers.IContainerInfo.StartTime
get

Gets the time when the container was most recently started, or null if the container has not been started yet.

Caution: It's possible for the StopTime to be earlier than this, if the container previously exited, was restarted, and has not yet exited since the most recent restart.

◆ State

ContainerStatus DockerSdk.Containers.IContainerInfo.State
get

Gets a value that summarizes the container's overall state at the time of the query.

The container's status might change between when the daemon reads it and when this object is available for reading. Beware of race conditions.

◆ StopTime

DateTimeOffset? DockerSdk.Containers.IContainerInfo.StopTime
get

Gets the time when the container most recently exited, or null if the container has never exited.

Caution: It's possible for this to be non-null for a running/paused container and earlier than StartTime. This is true if the container previously exited, was restarted, and has not yet exited since the most recent restart. I've also observed it being slightly before the start time even in a container that was never restarted–perhaps due to some timing bug in Docker.


The documentation for this interface was generated from the following file: