ContainerReaper Class

A watchdog container that removes the containers, images and volumes of the current session when this process goes away, including when it is killed and cannot run its own cleanup.

public sealed class ContainerReaper : IAsyncDisposable

Remarks

Dispose the instance to stop the watchdog. A clean disposal removes the watchdog before it can remove anything, so the resources the process still owns are left to their own disposal.

Implements

Properties

NameDescription
ContainerIdGets the id of the watchdog container.
SessionIdGets the session the watchdog removes the resources of.

Gets the id of the watchdog container.

public string ContainerId { get; }

Property value

string

Gets the session the watchdog removes the resources of.

public string SessionId { get; }

Property value

string

Methods

NameDescription
DisposeAsync()Stops the watchdog. The watchdog container is removed first, so it cannot remove the resources that are still in use.

DisposeAsync()

ContainerReaper.cs

Stops the watchdog. The watchdog container is removed first, so it cannot remove the resources that are still in use.

net10.0

public ValueTask DisposeAsync()

net11.0

public ValueTask DisposeAsync()

Returns

ValueTask A task that completes once the watchdog is stopped.