ImageSource Class

Describes where the image used to create a container comes from.

public closed class ImageSource : IEquatable<ImageSource>
Implements

Constructors

NameDescription
ImageSource()
ImageSource(ImageSource)

ImageSource overloads

ImageSource()

protected ImageSource()

No documentation is available.

ImageSource(ImageSource)

ImageSource.cs
protected ImageSource(ImageSource original)
Parameters
original ImageSource

No documentation is available.

Methods

NameDescription
Equals(ImageSource?)
Equals(object?)
FromArchive(string)Creates an image source from a Docker image archive produced by docker save.
FromDockerfile(string, string?)Creates an image source from a Dockerfile and build context directory.
FromDockerfile(string, string?, DockerfileBuildOptions?)Creates an image source from a Dockerfile, a build context directory, and build options.
FromExisting(string)Creates an image source from an image that already exists locally.
FromRegistry(string)Creates an image source from a registry reference (for example redis:8).
GetHashCode()
PrintMembers(StringBuilder)
ToString()

Equals overloads

Equals(ImageSource?)

public virtual bool Equals(ImageSource? other)
Parameters
other ImageSource?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

FromArchive(string)

ImageSource.cs

Creates an image source from a Docker image archive produced by docker save.

public static ImageSource FromArchive(string archivePath)

Parameters

archivePath string
The path to the image archive.

Returns

ImageSource

FromDockerfile overloads

FromDockerfile(string, string?)

ImageSource.cs

Creates an image source from a Dockerfile and build context directory.

public static ImageSource FromDockerfile(string dockerfilePath, string? contextDirectory = null)
Parameters
dockerfilePath string
The path to the Dockerfile.
contextDirectory string?
The build context directory.
Returns

ImageSource

FromDockerfile(string, string?, DockerfileBuildOptions?)

ImageSource.cs

Creates an image source from a Dockerfile, a build context directory, and build options.

public static ImageSource FromDockerfile(string dockerfilePath, string? contextDirectory, DockerfileBuildOptions? options)
Parameters
dockerfilePath string
The path to the Dockerfile.
contextDirectory string?
The build context directory. When null, the directory of the Dockerfile.
options DockerfileBuildOptions?
The build options, copied by this method. When null, the default options.
Returns

ImageSource

FromExisting(string)

ImageSource.cs

Creates an image source from an image that already exists locally.

public static ImageSource FromExisting(string imageId)

Parameters

imageId string
The image id or name.

Returns

ImageSource

FromRegistry(string)

ImageSource.cs

Creates an image source from a registry reference (for example redis:8).

public static ImageSource FromRegistry(string name)

Parameters

name string
The image name, optionally including a tag or digest.

Returns

ImageSource

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(ImageSource?, ImageSource?)
implicit operator ImageSource(string)
operator !=(ImageSource?, ImageSource?)

operator ==(ImageSource?, ImageSource?)

public static bool operator ==(ImageSource? left, ImageSource? right)

Parameters

left ImageSource?
right ImageSource?

Returns

bool

No documentation is available.

implicit operator ImageSource(string)

ImageSource.cs
public static implicit operator ImageSource(string name)

Parameters

name string

Returns

ImageSource

No documentation is available.

operator !=(ImageSource?, ImageSource?)

public static bool operator !=(ImageSource? left, ImageSource? right)

Parameters

left ImageSource?
right ImageSource?

Returns

bool

No documentation is available.