Table of Contents

Class ContainerExecutor

Namespace
Ando.Execution
Assembly
ando.dll

Executes commands inside a Docker container via 'docker exec'. Provides real-time output streaming and working directory management. Implements ICommandExecutor for seamless switching between local and container execution.

public class ContainerExecutor : CommandExecutorBase, ICommandExecutor
Inheritance
ContainerExecutor
Implements
Inherited Members

Constructors

ContainerExecutor(string, IBuildLogger, string)

Creates a new ContainerExecutor.

public ContainerExecutor(string containerId, IBuildLogger logger, string containerWorkDir = "/workspace")

Parameters

containerId string

Docker container ID or name (container must be running)

logger IBuildLogger

Logger for output streaming

containerWorkDir string

Working directory inside the container (default: /workspace)

Methods

IsAvailable(string)

Checks if a command is available inside the container. Uses 'which' command to locate the binary.

public override bool IsAvailable(string command)

Parameters

command string

Returns

bool

PrepareProcessStartInfo(string, string[], CommandOptions)

Prepares the ProcessStartInfo for command execution. Subclasses override this to customize the command setup (e.g., wrapping in docker exec).

protected override ProcessStartInfo PrepareProcessStartInfo(string command, string[] args, CommandOptions options)

Parameters

command string
args string[]
options CommandOptions

Returns

ProcessStartInfo

SetHostRootPath(string)

Sets the host root path for path translation. Call this after construction when the host project path is known.

public void SetHostRootPath(string hostRootPath)

Parameters

hostRootPath string

Absolute path to project root on the host.