DockerHostLocal class
DockerHost Implementation for Local Docker machine host.
- Inheritance
-
- Object
- DockerHost
- DockerHostLocal
Constructors
- DockerHostLocal({String? dockerBinaryPath})
Properties
- defaultOutputTime → Duration
-
The default timeout to wait data in STDOUT/STDERR outputs.
no setterinherited
- dockerBinaryPath → String?
-
The Docker binary path.
no setter
- dockerCommander → DockerCommander
-
Returns the DockerCommander used to initialize this instance.
no setteroverride
- formulaRepository ↔ DockerCommanderFormulaRepository
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitialized → bool
-
Returns true if this instance is initialized.
no setteroverride
- isSuccessfullyInitialized → bool
-
Returns true if this instance is successfully initialized.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- session → int
-
finalinherited
- temporaryDirectory → Directory?
-
Returns the temporary directory for this instance.
no setter
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, {bool addCIDFile = false}) → ContainerInfosLocal -
override
-
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.
inherited
-
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.
inherited
-
checkDaemon(
) → Future< bool> -
Checks if Docker daemon is running.
override
-
close(
) → Future< void> -
Closes this instances.
Clears the temporaryDirectory directory if necessary.
override
-
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
.override -
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 optionalversion
.override -
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 optionalversion
. Note that the Docker Daemon should be in Swarm mode.inherited -
createTempFile(
String content) → Future< String> - Creates a temporary file.
-
deleteTempFile(
String filePath) → Future< bool> -
Deletes a temporary
filePath
. -
exec(
String containerName, String command, List< String> args, {bool? outputAsLines = true, int? outputLimit, OutputReadyFunction? stdoutReadyFunction, OutputReadyFunction? stderrReadyFunction, OutputReadyType? outputReadyType}) → Future<DockerProcess?> -
Executes a
command
insidecontainerName
withargs
.override -
execAnConfirmExit(
String containerName, String command, List< String> args, int desiredExitCode) → Future<bool> -
Calls
exec
thanwaitExit
.inherited -
execAndWaitExit(
String containerName, String command, List< String> args, {int? desiredExitCode}) → Future<int?> -
Calls
exec
thanwaitExit
.inherited -
execAndWaitStderr(
String containerName, String command, List< String> args, {int? desiredExitCode}) → Future<Output?> -
Calls
exec
thanwaitStderr
.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
thanwaitStdout
.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. Callsexec
with commandwhich
and argscommandName
. Caches response than returns the executable path forcommandName
.inherited -
formulaExec(
String formulaName, String functionName, [List? arguments, Map< String, dynamic> ? fields]) → Future -
Executes a formula function.
override
-
getContainerIDByName(
String? name) → Future< String?> -
Returns a Docker container ID with
name
.inherited -
getFormulaClassName(
String formulaName) → Future< String?> -
Returns the class name of a formula.
override
-
getFormulaFields(
String formulaName) → Future< Map< String, Object> > -
Returns the formula fields/properties.
override
-
getNetworkRunnersHostnames(
String network) → List< String> -
getNetworkRunnersHostnamesAndIPs(
String? network) → Map< String, Map< String, String> > -
getNetworkRunnersIPs(
String network) → List< String> -
getNetworkRunnersIPsAndHostnames(
String network) → Map< String?, String?> -
getNetworkRunnersNames(
String network) → List< String> -
getProcessByInstanceID(
int? instanceID) → DockerProcessLocal? -
Returns a DockerProcess with
instanceID
.override -
getRunnerByInstanceID(
int? instanceID) → DockerRunnerLocal? -
Returns a DockerRunner with
instanceID
.override -
getRunnerByName(
String name) → DockerRunner? -
Returns a DockerRunner with
name
.override -
getRunnersInstanceIDs(
) → List< int> -
Returns a List<int> of DockerRunner
instanceID
.override -
getRunnersIPs(
) → List< String> -
getRunnersNames(
) → List< String> -
Returns a List<String> of DockerRunner
name
.override -
getServiceIDByName(
String name) → Future< String?> -
Returns a Docker service ID with
name
.inherited -
initialize(
DockerCommander dockerCommander) → Future< bool> -
Initializes instance.
override
-
isContainerARunner(
String containerName) → bool -
Returns
true
containerName
has a DockerRunner. -
isContainerRunnerRunning(
String containerName) → bool -
Returns
true
if DockerRunner ofcontainerName
is running. -
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.
override
-
listFormulasNames(
) → Future< List< String> > -
List the current available formulas names.
override
-
listServiceTasks(
String name) → Future< List< ServiceTaskInfos> ?> -
Returns a list of ServiceTaskInfos of a service by
serviceName
.inherited -
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
.inherited -
openServiceLogs(
String serviceNameOrTask) → Future< DockerProcess?> -
Opens a Service logs, by
serviceNameOrTask
.inherited -
removeContainer(
String containerNameOrID, {bool force = false}) → Future< bool> -
Removes a container by
containerNameOrID
.inherited -
removeService(
String name) → Future< bool> -
Removes a service from the Swarm cluster by
name
.inherited -
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 optionalversion
.override -
startContainer(
String? containerNameOrID) → Future< bool> -
Starts a container by
containerNameOrID
.inherited -
stopByInstanceID(
int instanceID, {Duration? timeout}) → Future< bool> -
Stops a container by
instanceID
.inherited -
stopByName(
String name, {Duration? timeout}) → Future< bool> -
Stops a container by
name
.override -
stopRunners(
) → Future< void> -
Stops all DockerRunner returned by getRunnersInstanceIDs.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- exitedProcessExpireTime → Duration
-
final
Static Methods
-
resolveDockerBinaryPath(
) → Future< String> -
Resolves the full path of the Docker binary.
If fails to resolve, returns
docker
.