DockerContainer class

A Docker container being executed.

Implementers

Constructors

DockerContainer(DockerRunner runner)

Properties

containerPorts List<int>
List of container ports.
no setter
hashCode int
The hash code for this object.
no setterinherited
hostPorts List<int>
List of host ports.
no setter
id String?
ID of the Docker container.
no setter
instanceID int
Dart instance ID.
no setter
isReady bool
Returns true if this container is started and ready.
no setter
isRunning bool
Returns true if this containers is running.
no setter
name String
Name of the Docker container.
no setter
ports List<String>
List of mapped ports.
no setter
portsAsPair List<Pair<int>>
List of mapped ports as Pair<int>.
no setter
runner DockerRunner
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stderr Output?
The STDERR of the container.
no setter
stdout Output?
The STDOUT of the container.
no setter

Methods

appendFileContent(String filePath, String content, {bool sudo = false}) Future<bool>
Append to the file filePath with content, inside this container.
catLogs({bool stderr = false, Pattern? waitDataMatcher, Duration? waitDataTimeout, bool waitExit = false, int? desiredExitCode, bool follow = false}) Future<String?>
Returns this Container logs as String.
copyFileFromContainer(String containerFilePath, String hostFilePath) Future<bool>
Copy a file inside this container, with path containerFilePath, to the host machine, at hostFilePath.
copyFileToContainer(String hostFilePath, String containerFilePath) Future<bool>
Copy a host file, at hostFilePath, inside this container, with internal file path containerFilePath.
exec(String command, List<String> args, {bool outputAsLines = true, int? outputLimit, OutputReadyFunction? stdoutReadyFunction, OutputReadyFunction? stderrReadyFunction, OutputReadyType? outputReadyType}) Future<DockerProcess?>?
Executes a command inside this container with args (if isRunning or returns null).
execAndWaitExit(String command, List<String> args) Future<int?>
Calls exec than waitExit.
execAndWaitStderr(String command, List<String> args, {int? desiredExitCode}) Future<Output?>
Calls exec than waitStderr.
execAndWaitStderrAsString(String command, List<String> args, {bool trim = false, int? desiredExitCode}) Future<String?>
Calls execAndWaitStderrAsString and returns Output.asString.
execAndWaitStdout(String command, List<String> args, {int? desiredExitCode}) Future<Output?>
Calls exec than waitStdout.
execAndWaitStdoutAsString(String command, List<String> args, {bool trim = false, int? desiredExitCode}) Future<String?>
Calls execAndWaitStdoutAsString and returns Output.asString.
execCat(String filePath, {bool trim = false}) Future<String?>
Call POSIX cat command. Calls exec with command cat and args filePath. Returns the executable path for filePath.
execShell(String script, {bool sudo = false}) Future<DockerProcess?>
Executes a shell script. Tries to use bash or sh. Note that script should be inline, without line breaks (\n).
execWhich(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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openLogs(String containerNameOrID) Future<DockerProcess?>
Opens this Container logs:
putFileContent(String filePath, String content, {bool sudo = false, bool append = false}) Future<bool>
Save the file filePath with content, inside this container.
stop({Duration? timeout}) Future<bool>
Stops this container.
toString() String
A string representation of this object.
override
waitExit() Future<int?>
Waits container to exit. Returns the process exit code.
waitReady() Future<bool>
Waits for the container, ensuring that is started.

Operators

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