ContainerCleanupOptions Class
Configures what ContainerRuntime.CleanupAsync removes.
public sealed class ContainerCleanupOptionsConstructors
| Name | Description |
|---|---|
| ContainerCleanupOptions() |
ContainerCleanupOptions()
ContainerCleanupOptions.cspublic ContainerCleanupOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| IncludeContainers | Gets or sets a value indicating whether containers are removed. Defaults to true. |
| IncludeImages | 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. |
| IncludeNetworks | 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. |
| IncludeReusedResources | 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. |
| IncludeVolumes | 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. |
| MinimumAge | Gets or sets the minimum age a resource must have to be removed. Defaults to TimeSpan.Zero, which removes a resource whatever its age. |
| Scope | Gets or sets which resources are removed. Defaults to ContainerCleanupScope.Orphaned. |
IncludeContainers
ContainerCleanupOptions.csIncludeImages
ContainerCleanupOptions.csGets 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; }IncludeNetworks
ContainerCleanupOptions.csIncludeReusedResources
ContainerCleanupOptions.csGets 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
IncludeVolumes
ContainerCleanupOptions.csMinimumAge
ContainerCleanupOptions.csGets 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
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; }