protected function runCommandInContainer(
        $container_id,
        $command,
        array $options = [],
        $quiet = false,
        $interactive = false
    ) {
        if (!isset($container_id) || !isset($command)) {
            return false;
        }
        /** @var Exec $docker_execute */
        $docker_execute = $this->taskDockerExec($container_id);

        if ($quiet) {
            $docker_execute->printOutput(false);
        }

        if ($interactive) {
            $docker_execute->interactive(true);
        }

        if (!empty($options)) {
            $docker_execute->options($options);
        }

        return $docker_execute
            ->exec("sh -c \"{$command}\"")
            ->run();
    }
protected function runCommandInContainer(
        $container_id,
        $command,
        array $options = [],
        $quiet = false,
        $interactive = false
    ) {
        if (!isset($container_id) || !isset($command)) {
            return false;
        }
        /** @var Exec $docker_execute */
        $docker_execute = $this->taskDockerExec($container_id);

        if ($quiet) {
            $docker_execute->printOutput(false);
        }

        if ($interactive) {
            $docker_execute->interactive(true);
        }

        if (!empty($options)) {
            $docker_execute->options($options);
        }

        return $docker_execute
            ->exec("sh -c \"{$command}\"")
            ->run();
    }
protected function runCommandInContainer ( $ container_id , $ command , array $ options = [ ] , $ quiet = false , $ interactive = false ) { if ( ! isset ( $ container_id ) || ! isset ( $ command ) ) { return false ; } /** @var Exec $docker_execute */ $ docker_execute = $ this -> taskDockerExec ( $ container_id ) ; if ( $ quiet ) { $ docker_execute -> printOutput ( false ) ; } if ( $ interactive ) { $ docker_execute -> interactive ( true ) ; } if ( ! empty ( $ options ) ) { $ docker_execute -> options ( $ options ) ; } return $ docker_execute -> exec ( "sh -c \"{$command}\"" ) -> run ( ) ; }
Run a command in docker container.

@param $container_id
The docker container id.
@param string|Command $command
A string or command object.
@param array $options
An array of command options.
@param bool $quiet
Determine if the command should print output.
@param bool $interactive
Determine if the command should run in interactive mode.

@return ResultData
Run a command in docker container .