2 namespace Robo\Task\Docker;
4 use Robo\Common\CommandReceiver;
7 * Executes command inside running Docker container
11 * $test = $this->taskDockerRun('test_env')
15 * $this->taskDockerExec($test)
17 * ->exec('./runtests')
20 * // alternatively use commands from other tasks
22 * $this->taskDockerExec($test)
24 * ->exec($this->taskCodecept()->suite('acceptance'))
30 class Exec extends Base
37 protected $command = "docker exec";
50 * @param string|\Robo\Result $cidOrResult
52 public function __construct($cidOrResult)
54 $this->cid = $cidOrResult instanceof Result ? $cidOrResult->getCid() : $cidOrResult;
60 public function detached()
69 public function interactive($interactive = true)
74 return parent::interactive($interactive);
78 * @param string|\Robo\Contract\CommandInterface $command
82 public function exec($command)
84 $this->run = $this->receiveCommand($command);
91 public function getCommand()
93 return $this->command . ' ' . $this->arguments . ' ' . $this->cid.' '.$this->run;