DockerSdk
the .NET SDK for Docker
Classes | Public Member Functions | Properties | List of all members
DockerSdk.Images.ImageAccess Class Reference

Provides methods for interacting with Docker images. More...

Inheritance diagram for DockerSdk.Images.ImageAccess:

Public Member Functions

Task< IImageGetAsync (string image, CancellationToken ct=default)
 Loads an object that can be used to interact with the indicated image. More...
 
Task< IImageGetAsync (ImageReference image, CancellationToken ct=default)
 Loads an object that can be used to interact with the indicated image. More...
 
Task< IImageInfoGetDetailsAsync (string image, CancellationToken ct=default)
 Loads detailed information about an image. More...
 
Task< IImageInfoGetDetailsAsync (ImageReference image, CancellationToken ct=default)
 Loads detailed information about an image. More...
 
Task< IReadOnlyList< IImage > > ListAsync (CancellationToken ct=default)
 Gets a list of Docker images known to the daemon. More...
 
async Task< IReadOnlyList< IImage > > ListAsync (ListImagesOptions options, CancellationToken ct=default)
 Gets a list of Docker images known to the daemon. More...
 
Task< IImagePullAsync (string image, CancellationToken ct=default)
 Retrieves the indicated image from its remote home. More...
 
async Task< IImagePullAsync (ImageReference image, CancellationToken ct=default)
 Retrieves the indicated image from its remote home. More...
 
IDisposable Subscribe (IObserver< ImageEvent > observer)
 Subscribes to events about images. More...
 

Properties

Builder Builder [get]
 Gets a service for building Docker images. More...
 

Detailed Description

Provides methods for interacting with Docker images.

Member Function Documentation

◆ GetAsync() [1/2]

Task<IImage> DockerSdk.Images.ImageAccess.GetAsync ( ImageReference  image,
CancellationToken  ct = default 
)
inline

Loads an object that can be used to interact with the indicated image.

Parameters
imageAn image name or ID.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the image object.
Exceptions
ImageNotFoundLocallyExceptionNo such image exists.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as loss of network connectivity.

◆ GetAsync() [2/2]

Task<IImage> DockerSdk.Images.ImageAccess.GetAsync ( string  image,
CancellationToken  ct = default 
)

Loads an object that can be used to interact with the indicated image.

Parameters
imageAn image name or ID.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the image object.
Exceptions
ImageNotFoundLocallyExceptionNo such image exists.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as loss of network connectivity.
MalformedReferenceExceptionThe image reference is improperly formatted.

◆ GetDetailsAsync() [1/2]

Task<IImageInfo> DockerSdk.Images.ImageAccess.GetDetailsAsync ( ImageReference  image,
CancellationToken  ct = default 
)

Loads detailed information about an image.

Parameters
imageAn image name or ID.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the details.
Exceptions
ImageNotFoundExceptionNo such image exists.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity.

◆ GetDetailsAsync() [2/2]

Task<IImageInfo> DockerSdk.Images.ImageAccess.GetDetailsAsync ( string  image,
CancellationToken  ct = default 
)

Loads detailed information about an image.

Parameters
imageAn image name or ID.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the details.
Exceptions
ImageNotFoundExceptionNo such image exists.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity.
MalformedReferenceExceptionThe image reference is improperly formatted.

◆ ListAsync() [1/2]

Task<IReadOnlyList<IImage> > DockerSdk.Images.ImageAccess.ListAsync ( CancellationToken  ct = default)

Gets a list of Docker images known to the daemon.

Parameters
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the list of images.

This method does not necessarily return the same results as the docker image ls command. To get the same results, use the ListAsync(ListImagesOptions, CancellationToken) overload and give it the ListImagesOptions.CommandLineDefaults options.

The sequence of the results is undefined.

◆ ListAsync() [2/2]

async Task<IReadOnlyList<IImage> > DockerSdk.Images.ImageAccess.ListAsync ( ListImagesOptions  options,
CancellationToken  ct = default 
)
inline

Gets a list of Docker images known to the daemon.

Parameters
optionsFilters for the search.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the list of images.

This method does not necessarily return the same results as the docker image ls command by default. To get the same results, pass in ListImagesOptions.CommandLineDefaults.

The sequence of the results is undefined.

Exceptions
ArgumentNullExceptionoptions is null.

◆ PullAsync() [1/2]

async Task<IImage> DockerSdk.Images.ImageAccess.PullAsync ( ImageReference  image,
CancellationToken  ct = default 
)
inline

Retrieves the indicated image from its remote home.

Parameters
imageA reference to the image to fetch.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the downloaded image.

This instructs the Docker daemon to download the image from the image's home registry. The registry is determined based on the image's name, defaulting to "docker.io".

Exceptions
ArgumentExceptionimage is null.
InvalidOperationExceptionOne Task removed the auth object while another was getting it.
RegistryAuthExceptionThe registry requires credentials that the client hasn't been given.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout.
ImageNotFoundRemotelyExceptionThe image does not exist at the Registry indicated by its name.

◆ PullAsync() [2/2]

Task<IImage> DockerSdk.Images.ImageAccess.PullAsync ( string  image,
CancellationToken  ct = default 
)

Retrieves the indicated image from its remote home.

Parameters
imageA reference to the image to fetch.
ctA token used to cancel the operation.
Returns
A Task<TResult> that resolves to the downloaded image.

This instructs the Docker daemon to download the image from the image's home registry. The registry is determined based on the image's name, defaulting to "docker.io".

Exceptions
ArgumentExceptionimage is null or empty.
MalformedReferenceExceptionThe input could not be parsed as an image name.
InvalidOperationExceptionOne Task removed the auth object while another was getting it.
RegistryAuthExceptionThe registry requires credentials that the client hasn't been given.
System.Net.Http.HttpRequestExceptionThe request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout.
ImageNotFoundRemotelyExceptionThe image does not exist at the Registry indicated by its name.

◆ Subscribe()

IDisposable DockerSdk.Images.ImageAccess.Subscribe ( IObserver< ImageEvent observer)

Subscribes to events about images.

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

Property Documentation

◆ Builder

Builder DockerSdk.Images.ImageAccess.Builder
get

Gets a service for building Docker images.


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