Table of Contents

Class DockerManager

Namespace
Ando.Execution
Assembly
ando.dll

Manages Docker container lifecycle for isolated build execution. Implements warm container pattern for fast subsequent builds.

public class DockerManager
Inheritance
DockerManager
Inherited Members

Constructors

DockerManager(IBuildLogger)

public DockerManager(IBuildLogger logger)

Parameters

logger IBuildLogger

Methods

CheckDockerAvailability()

Checks Docker availability with a detailed failure reason. Distinguishes between CLI not installed and daemon not running to provide actionable, platform-specific error messages.

public DockerAvailability CheckDockerAvailability()

Returns

DockerAvailability

CleanArtifactsAsync(string)

Cleans artifacts directory inside the container.

public Task CleanArtifactsAsync(string containerId)

Parameters

containerId string

Returns

Task

CopyProjectToContainerAsync(string, string)

Copies project files from host to container's /workspace directory. Excludes large/generated directories for efficiency. This is the key to isolation - the container works on a copy, not the original.

public Task CopyProjectToContainerAsync(string containerId, string projectRoot)

Parameters

containerId string
projectRoot string

Returns

Task

EnsureContainerAsync(ContainerConfig)

Creates a new container or starts an existing one. For warm containers, re-copies project files to ensure fresh state. If --dind is requested but existing container doesn't have Docker socket, recreates it.

public Task<ContainerInfo> EnsureContainerAsync(ContainerConfig config)

Parameters

config ContainerConfig

Returns

Task<ContainerInfo>

FindWarmContainerAsync(string)

Finds an existing warm container for the project.

public Task<ContainerInfo?> FindWarmContainerAsync(string containerName)

Parameters

containerName string

Returns

Task<ContainerInfo>

GetDockerInstallInstructions()

Gets installation instructions for the current OS.

public string GetDockerInstallInstructions()

Returns

string

HasDockerSocketMountedAsync(string)

Checks if the Docker socket is mounted in a container. Used to determine if an existing warm container supports --dind mode.

public Task<bool> HasDockerSocketMountedAsync(string containerId)

Parameters

containerId string

Returns

Task<bool>

IsDockerAvailable()

Checks if Docker is available on the system. Convenience wrapper around CheckDockerAvailability().

public bool IsDockerAvailable()

Returns

bool

RemoveContainerAsync(string)

Removes a container.

public Task RemoveContainerAsync(string containerName)

Parameters

containerName string

Returns

Task

StopContainerAsync(string)

Stops a running container.

public Task StopContainerAsync(string containerId)

Parameters

containerId string

Returns

Task