public function kill() { if ($this->exists()) { writeln("<comment>Kill elasticsearch container {$this->container}</comment>"); $command = Env::evalDocker() . "docker rm -f {$this->container}"; runLocally($command); } }
public function exists() { $command = Env::evalDocker() . "docker inspect {$this->container}"; try { $output = runLocally($command); return true; } catch (\Exception $ex) { return false; } }
public static function doLocal($command, $timeout = 999) { writeln('==================================================='); writeln('Running command:'); writeln($command); writeln('==================================================='); return runLocally(Env::evalDocker() . $command, $timeout); }