DockerHost class abstract

Base class for Docker machine host.

Implementers

Constructors

DockerHost()

Properties

defaultOutputTime Duration
The default timeout to wait data in STDOUT/STDERR outputs.
no setterinherited
dockerCommander DockerCommander
Returns the DockerCommander used to initialize this instance.
no setter
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Returns true if this instance is initialized.
no setter
isSuccessfullyInitialized bool
Returns true if this instance is successfully initialized.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session int
final

Methods

buildContainerArgs(String cmd, String imageName, String? version, String containerName, List<String>? ports, String? network, String? hostname, Map<String, String>? environment, Map<String, String>? volumes, bool cleanContainer, String? healthCmd, Duration? healthInterval, int? healthRetries, Duration? healthStartPeriod, Duration? healthTimeout, String? restart) ContainerInfos
catContainerLogs(String containerNameOrID, {bool stderr = false, Pattern? waitDataMatcher, Duration? waitDataTimeout, bool waitExit = false, int? desiredExitCode, bool follow = false}) Future<String?>
Returns the Container logs as String.
catServiceLogs(String containerNameOrID, {bool stderr = false, Pattern? waitDataMatcher, Duration? waitDataTimeout, bool waitExit = false, int? desiredExitCode, bool follow = false}) Future<String?>
Returns a Service logs as String.
checkDaemon() Future<bool>
Checks if Docker daemon is running.
close() Future<void>
Closes this instance, cleaning any resource.
command(String command, List<String> args, {bool outputAsLines = true, int? outputLimit, OutputReadyFunction? stdoutReadyFunction, OutputReadyFunction? stderrReadyFunction, OutputReadyType? outputReadyType}) Future<DockerProcess?>
Executes an arbitrary Docker command with args.
createContainer(String containerName, String imageName, {String? version, List<String>? ports, String? network, String? hostname, Map<String, String>? environment, Map<String, String>? volumes, bool cleanContainer = false, String? healthCmd, Duration? healthInterval, int? healthRetries, Duration? healthStartPeriod, Duration? healthTimeout, String? restart}) Future<ContainerInfos?>
Creates a Docker containers with image and optional version.
createService(String serviceName, String imageName, {String? version, int? replicas, List<String>? ports, String? network, String? hostname, Map<String, String>? environment, Map<String, String>? volumes, String? healthCmd, Duration? healthInterval, int? healthRetries, Duration? healthStartPeriod, Duration? healthTimeout}) Future<Service?>
Creates a Docker service with serviceName, image and optional version. Note that the Docker Daemon should be in Swarm mode.
createTempFile(String content) Future<String?>
Creates a temporary file.
inherited
deleteTempFile(String filePath) Future<bool>
Deletes a temporary filePath.
inherited
exec(String containerName, String command, List<String> args, {bool outputAsLines = true, int? outputLimit, OutputReadyFunction? stdoutReadyFunction, OutputReadyFunction? stderrReadyFunction, OutputReadyType? outputReadyType}) Future<DockerProcess?>
Executes a command inside containerName with args.
execAnConfirmExit(String containerName, String command, List<String> args, int desiredExitCode) Future<bool>
Calls exec than waitExit.
inherited
execAndWaitExit(String containerName, String command, List<String> args, {int? desiredExitCode}) Future<int?>
Calls exec than waitExit.
inherited
execAndWaitStderr(String containerName, String command, List<String> args, {int? desiredExitCode}) Future<Output?>
Calls exec than waitStderr.
inherited
execAndWaitStderrAsString(String containerName, String command, List<String> args, {bool trim = false, int? desiredExitCode, Pattern? dataMatcher}) Future<String?>
Calls execAndWaitStderrAsString and returns Output.asString.
inherited
execAndWaitStdout(String containerName, String command, List<String> args, {int? desiredExitCode}) Future<Output?>
Calls exec than waitStdout.
inherited
execAndWaitStdoutAsString(String containerName, String command, List<String> args, {bool trim = false, int? desiredExitCode, Pattern? dataMatcher}) Future<String?>
Calls execAndWaitStdoutAsString and returns Output.asString.
inherited
execWhich(String containerName, String commandName, {bool ignoreCache = false, String? def}) Future<String?>
Call POSIX which command. Calls exec with command which and args commandName. Caches response than returns the executable path for commandName.
inherited
formulaExec(String formulaName, String functionName, [List? arguments, Map<String, dynamic>? fields]) Future
Executes a formula function.
getContainerIDByName(String? name) Future<String?>
Returns a Docker container ID with name.
getFormulaClassName(String formulaName) Future<String?>
Returns the class name of a formula.
getFormulaFields(String formulaName) Future<Map<String, Object>>
Returns the formula fields/properties.
getProcessByInstanceID(int instanceID) DockerProcess?
Returns a DockerProcess with instanceID.
getRunnerByInstanceID(int instanceID) DockerRunner?
Returns a DockerRunner with instanceID.
getRunnerByName(String name) DockerRunner?
Returns a DockerRunner with name.
getRunnersInstanceIDs() List<int>
Returns a List<int> of DockerRunner instanceID.
getRunnersNames() List<String>
Returns a List<String> of DockerRunner name.
getServiceIDByName(String name) Future<String?>
Returns a Docker service ID with name.
initialize(DockerCommander dockerCommander) Future<bool>
Initializes instance.
isContainerARunner(String containerName) bool
Returns true containerName has a DockerRunner.
inherited
isContainerRunnerRunning(String containerName) bool
Returns true if DockerRunner of containerName is running.
inherited
isContainerRunning(String containerName) Future<bool>
Returns if containerName is running (checks at Docker Daemon).
inherited
listFormulasFunctions(String formulaName) Future<List<String>>
List the functions of a formula.
listFormulasNames() Future<List<String>>
List the current available formulas names.
listServiceTasks(String name) Future<List<ServiceTaskInfos>?>
Returns a list of ServiceTaskInfos of a service by serviceName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openContainerLogs(String containerNameOrID) Future<DockerProcess?>
Opens a Container logs, by containerNameOrID.
openServiceLogs(String serviceNameOrTask) Future<DockerProcess?>
Opens a Service logs, by serviceNameOrTask.
removeContainer(String containerNameOrID, {bool force = false}) Future<bool>
Removes a container by containerNameOrID.
removeService(String name) Future<bool>
Removes a service from the Swarm cluster by name.
run(String image, {String? version, List<String>? imageArgs, String? containerName, List<String>? ports, String? network, String? hostname, Map<String, String>? environment, Map<String, String>? volumes, bool cleanContainer = true, String? healthCmd, Duration? healthInterval, int? healthRetries, Duration? healthStartPeriod, Duration? healthTimeout, String? restart, bool outputAsLines = true, int? outputLimit, OutputReadyFunction? stdoutReadyFunction, OutputReadyFunction? stderrReadyFunction, OutputReadyType? outputReadyType}) Future<DockerRunner?>
Runs a Docker containers with image and optional version.
startContainer(String? containerNameOrID) Future<bool>
Starts a container by containerNameOrID.
stopByInstanceID(int instanceID, {Duration? timeout}) Future<bool>
Stops a container by instanceID.
stopByName(String name, {Duration? timeout}) Future<bool>
Stops a container by name.
stopRunners() Future<void>
Stops all DockerRunner returned by getRunnersInstanceIDs.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

cleanupExitedProcessesImpl(Duration exitedProcessExpireTime, Map<int, DockerProcess> processes) → void
isDaemonRunning(DockerHost dockerHost, {bool allowCache = true}) FutureOr<bool>
Returns true if the Docker Daemon is running. The result is cached for the dockerHost. See resetIsDaemonRunningCache.
normalizeMappedPorts(List<String>? ports) List<String>?
resetIsDaemonRunningCache([DockerHost? dockerHost]) → void
Resets the cache for isDaemonRunning.
resolveImage(String imageName, [String? version]) String
Resolves a Docker image, composed by imageName and version.
resolveOutputReadyType(OutputReadyFunction? stdoutReadyFunction, OutputReadyFunction? stderrReadyFunction) OutputReadyType