DockerSdk
the .NET SDK for Docker
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
DockerSdk.DockerClient Class Reference

Provides remote access to a Docker daemon. More...

Inheritance diagram for DockerSdk.DockerClient:

Public Member Functions

IDisposable Subscribe (IObserver< Event > observer)
 Subscribes to events from the Docker daemon. More...
 
void Dispose ()
 

Static Public Member Functions

static Task< DockerClientStartAsync (CancellationToken ct=default)
 Creates a new Docker client and connects it to the local Docker daemon. More...
 
static Task< DockerClientStartAsync (Uri daemonUrl, CancellationToken ct=default)
 Creates a new Docker client and connects it to a Docker daemon. More...
 
static async Task< DockerClientStartAsync (ClientOptions options, CancellationToken ct=default)
 Creates a new Docker client and connects it to a Docker daemon. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Overridable Dispose method More...
 

Properties

Version ApiVersion [get]
 Gets the version of the Docker API that will be used to communicate with the Docker daemon. More...
 
ContainerAccess Containers [get]
 Provides access to functionality related to Docker containers. More...
 
ImageAccess Images [get]
 Provides access to functionality related to Docker images. More...
 
NetworkAccess Networks [get]
 Provides access to functionality related to Docker networks. More...
 
RegistryAccess Registries [get]
 Provides access to functionality related to Docker registries. More...
 

Detailed Description

Provides remote access to a Docker daemon.

Member Function Documentation

◆ Dispose()

virtual void DockerSdk.DockerClient.Dispose ( bool  disposing)
inlineprotectedvirtual

Overridable Dispose method

Parameters
disposing

◆ StartAsync() [1/3]

static Task<DockerClient> DockerSdk.DockerClient.StartAsync ( CancellationToken  ct = default)
static

Creates a new Docker client and connects it to the local Docker daemon.

Parameters
ctA token used to cancel the operation.
Returns
A Task that completes when the connection has been established.
Exceptions
DockerVersionExceptionThe API versions that the SDK supports don't overlap with the API versions that the daemon supports.
Core.DockerApiExceptionAn internal error occurred within the daemon.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout.

◆ StartAsync() [2/3]

static async Task<DockerClient> DockerSdk.DockerClient.StartAsync ( ClientOptions  options,
CancellationToken  ct = default 
)
inlinestatic

Creates a new Docker client and connects it to a Docker daemon.

Parameters
optionsDetails on how to connect and how the client should behave.
ctA token used to cancel the operation.
Returns
A Task that completes when the connection has been established.
Exceptions
ArgumentNullExceptionoptions is null.
DockerVersionExceptionThe API versions that the SDK supports don't overlap with the API versions that the daemon supports.
Core.DockerApiExceptionAn internal error occurred within the daemon.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout.
DaemonNotFoundExceptionThere is no running Docker daemon at the specified URL.

◆ StartAsync() [3/3]

static Task<DockerClient> DockerSdk.DockerClient.StartAsync ( Uri  daemonUrl,
CancellationToken  ct = default 
)
static

Creates a new Docker client and connects it to a Docker daemon.

Parameters
daemonUrlThe URL of the Docker daemon to connect to.
ctA token used to cancel the operation.
Returns
A Task that completes when the connection has been established.
Exceptions
DockerVersionExceptionThe API versions that the SDK supports don't overlap with the API versions that the daemon supports.
Core.DockerApiExceptionAn internal error occurred within the daemon.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout.
ArgumentExceptionThe URL is null.

◆ Subscribe()

IDisposable DockerSdk.DockerClient.Subscribe ( IObserver< Event observer)

Subscribes to events from the Docker daemon.

Parameters
observerAn object to observe the events.
Returns
An IDisposable representing the subscription. Disposing this unsubscribes and releases resources.

Property Documentation

◆ ApiVersion

Version DockerSdk.DockerClient.ApiVersion
get

Gets the version of the Docker API that will be used to communicate with the Docker daemon.

This will always be the highest version that both sides support.

◆ Containers

ContainerAccess DockerSdk.DockerClient.Containers
get

Provides access to functionality related to Docker containers.

◆ Images

ImageAccess DockerSdk.DockerClient.Images
get

Provides access to functionality related to Docker images.

◆ Networks

NetworkAccess DockerSdk.DockerClient.Networks
get

Provides access to functionality related to Docker networks.

◆ Registries

RegistryAccess DockerSdk.DockerClient.Registries
get

Provides access to functionality related to Docker registries.


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