Represents a Docker container.
More...
Represents a Docker container.
◆ AttachNetwork() [1/4]
Task DockerSdk.Containers.IContainer.AttachNetwork |
( |
NetworkReference |
network, |
|
|
AttachNetworkOptions |
options, |
|
|
CancellationToken |
ct = default |
|
) |
| |
Attaches a Docker network to the container.
- Parameters
-
network | A reference to the network. |
options | Options for how to perform the operation. |
ct | A token used to cancel the operation. |
- Returns
- A Task that resolves when the network has been attached.
- Exceptions
-
ArgumentNullException | One or more of the inputs are null. |
ArgumentException | The options input has invalid values, such as an IPv6 address in the AttachNetworkOptions.IPv6Address property. |
NetworkNotFoundException | The indicated network does not exist. |
ContainerNotFoundException | The container no longer exists. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ AttachNetwork() [2/4]
Task DockerSdk.Containers.IContainer.AttachNetwork |
( |
NetworkReference |
network, |
|
|
CancellationToken |
ct = default |
|
) |
| |
Attaches a Docker network to the container.
- Parameters
-
network | A reference to the network. |
ct | A token used to cancel the operation. |
- Returns
- A Task that resolves when the network has been attached.
- Exceptions
-
ArgumentNullException | network is null. |
NetworkNotFoundException | The indicated network does not exist. |
ContainerNotFoundException | The container no longer exists. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ AttachNetwork() [3/4]
Task DockerSdk.Containers.IContainer.AttachNetwork |
( |
string |
network, |
|
|
AttachNetworkOptions |
options, |
|
|
CancellationToken |
ct = default |
|
) |
| |
Attaches a Docker network to the container.
- Parameters
-
network | A reference to the network. |
options | Options for how to perform the operation. |
ct | A token used to cancel the operation. |
- Returns
- A Task that resolves when the network has been attached.
- Exceptions
-
ArgumentNullException | One or more of the inputs are null. |
ArgumentException | The options input has invalid values, such as an IPv6 address in the AttachNetworkOptions.IPv6Address property. |
NetworkNotFoundException | The indicated network does not exist. |
MalformedReferenceException | network is not a well-formed network reference. |
ContainerNotFoundException | The container no longer exists. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ AttachNetwork() [4/4]
Task DockerSdk.Containers.IContainer.AttachNetwork |
( |
string |
network, |
|
|
CancellationToken |
ct = default |
|
) |
| |
Attaches a Docker network to the container.
- Parameters
-
network | A reference to the network. |
ct | A token used to cancel the operation. |
- Returns
- A Task that resolves when the network has been attached.
- Exceptions
-
ArgumentNullException | network is null. |
NetworkNotFoundException | The indicated network does not exist. |
MalformedReferenceException | network is not a well-formed network reference. |
ContainerNotFoundException | The container no longer exists. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ GetDetailsAsync()
Task<IContainerInfo> DockerSdk.Containers.IContainer.GetDetailsAsync |
( |
CancellationToken |
ct = default | ) |
|
Gets detailed information about the container.
- Parameters
-
ct | A CancellationToken used to cancel the operation. |
- Returns
- A Task that completes when the result is available.
- Exceptions
-
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ StartAsync()
Task DockerSdk.Containers.IContainer.StartAsync |
( |
CancellationToken |
ct = default | ) |
|
Starts the container, if it is not already running.
- Parameters
-
ct | A token used to cancel the operation. |
- Returns
- A Task<TResult> that resolves when the container's main process has started.
From the perspective of Docker, there's no concept of whether the container's main process has "finished
starting"–just that the process has been started at all. Thus, for example, if the process is a web server, this method's Task
may resolve before the web server is ready for connections. If the application using this library needs to synchronize with events happening inside the container, it should monitor the container's logs or use other real-time mechanisms to do so.
It's also possible that a short-lived process might exit before the method's Task
resolves.
- Exceptions
-
ContainerNotFoundException | The indicated container no longer exists. |
NetworkNotFoundException | One of the networks specified during container creation does not exist. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ Id
Gets the container's full ID.
The documentation for this interface was generated from the following file: