ContainerCleanupOptions Class

Configures what ContainerRuntime.CleanupAsync removes.

public sealed class ContainerCleanupOptions

Constructors

NameDescription
ContainerCleanupOptions()

ContainerCleanupOptions()

ContainerCleanupOptions.cs
public ContainerCleanupOptions()

No documentation is available.

Properties

NameDescription
IncludeContainersGets or sets a value indicating whether containers are removed. Defaults to true.
IncludeImagesGets or sets a value indicating whether the images built from a Dockerfile are removed. Defaults to true. Images are removed after the containers, so an image a removed container used is no longer in use.
IncludeNetworksGets or sets a value indicating whether networks are removed. Defaults to true. Networks are removed after the containers, so a network a removed container joined is no longer in use.
IncludeReusedResourcesGets or sets a value indicating whether the resources created with a ContainerDefinition.ReuseId are removed. Defaults to false: such a resource outlives the run that created it on purpose, and another run may be using it right now.
IncludeVolumesGets or sets a value indicating whether volumes are removed. Defaults to true. Volumes are removed after the containers, so a volume a removed container used is no longer in use.
MinimumAgeGets or sets the minimum age a resource must have to be removed. Defaults to TimeSpan.Zero, which removes a resource whatever its age.
ScopeGets or sets which resources are removed. Defaults to ContainerCleanupScope.Orphaned.

Gets or sets a value indicating whether containers are removed. Defaults to true.

public bool IncludeContainers { get; set; }

Property value

bool

Gets or sets a value indicating whether the images built from a Dockerfile are removed. Defaults to true. Images are removed after the containers, so an image a removed container used is no longer in use.

public bool IncludeImages { get; set; }

Property value

bool

Remarks

wslc does not label the images it builds, so they are not found.

Gets or sets a value indicating whether networks are removed. Defaults to true. Networks are removed after the containers, so a network a removed container joined is no longer in use.

public bool IncludeNetworks { get; set; }

Property value

bool

IncludeReusedResources

ContainerCleanupOptions.cs

Gets or sets a value indicating whether the resources created with a ContainerDefinition.ReuseId are removed. Defaults to false: such a resource outlives the run that created it on purpose, and another run may be using it right now.

public bool IncludeReusedResources { get; set; }

Property value

bool

Gets or sets a value indicating whether volumes are removed. Defaults to true. Volumes are removed after the containers, so a volume a removed container used is no longer in use.

public bool IncludeVolumes { get; set; }

Property value

bool

Gets or sets the minimum age a resource must have to be removed. Defaults to TimeSpan.Zero, which removes a resource whatever its age.

public TimeSpan MinimumAge { get; set; }

Property value

TimeSpan

Remarks

A resource created by a version of the library that did not record a creation time is never removed when this is set.

Gets or sets which resources are removed. Defaults to ContainerCleanupScope.Orphaned.

public ContainerCleanupScope Scope { get; set; }

Property value

ContainerCleanupScope