exec method

  1. @override
Future<ExecResult> exec(
  1. String id,
  2. List<String> command
)
override

Runs command inside the container and waits for it to finish.

Nothing is written to the command's stdin. That restriction is what lets this use the ordinary HTTP client: Docker offers a hijacked bidirectional stream for interactive execs, and avoiding it avoids writing a second HTTP implementation.

A non-zero exit code is returned, not thrown. Whether a failed command is an error depends on what was asked, so the caller decides.

Implementation

@override
Future<ExecResult> exec(String id, List<String> command) async {
  calls.add('exec:$id:${command.join(' ')}');
  _require(id);
  return onExec(command);
}