DockerSdk
the .NET SDK for Docker
|
Holds detailed information about a Docker container. More...
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< INetworkEndpoint > | NetworkEndpoints [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, INetworkEndpoint > | 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. More... | |
IReadOnlyList< INetwork > | Networks [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... | |
![]() | |
ContainerFullId | Id [get] |
Gets the container's full ID. More... | |
Additional Inherited Members | |
![]() | |
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< IContainerInfo > | GetDetailsAsync (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... | |
Holds detailed information about a Docker container.
This class holds a snapshot in time. Its information is immutable once created.
|
get |
Gets the timestamp for when the container was created.
|
get |
Gets an error message for why the container exited. Not all exited containers will have this set.
|
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).
|
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.
|
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.
|
get |
Gets the Docker image that the container was created from.
|
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.
|
get |
Gets a value indicating whether the container was in the "running" state when the query was performed.
Cautions:
docker container inspect
command, this property does not consider paused containers to be "running". Instead, this is equivalent to State == ContainerStatus.Running
.
|
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.
|
get |
Gets the labels and their values that have been applied to the container.
|
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.
|
get |
Gets the containe's name.
|
get |
Gets a list of network endpoints on the container. A network end-point is the link between a container and a network.
|
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.
|
get |
Gets a list of networks attached to the container.
|
get |
Gets information about the network sandbox. The sandbox is in charge of the network endpoints.
|
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.
|
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.
|
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.
|
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.