|
@@ 75-88 (lines=14) @@
|
| 72 |
|
* @param mixed $composeFiles The compose files names |
| 73 |
|
* @param string $signal Optionnal to precise SIGNAL to send to the container for SIGKILL replacement. |
| 74 |
|
*/ |
| 75 |
|
public function kill($composeFiles = array(), $signal = 'SIGKILL') |
| 76 |
|
{ |
| 77 |
|
$command = 'kill'; |
| 78 |
|
|
| 79 |
|
if ($signal !== 'SIGKILL') { |
| 80 |
|
$command .= ' -s ' . $signal; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
return $this->processResult( |
| 84 |
|
$this->execute( |
| 85 |
|
$this->formatCommand($command, $this->createComposeFileCollection($composeFiles)) |
| 86 |
|
) |
| 87 |
|
); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
/** |
| 91 |
|
* Build service images |
|
@@ 144-157 (lines=14) @@
|
| 141 |
|
* @param mixed $composeFiles The compose files names |
| 142 |
|
* @param integer $timeout If we want attempt to pull a newer version of the from image |
| 143 |
|
*/ |
| 144 |
|
public function restart($composeFiles = array(), $timeout = 10) |
| 145 |
|
{ |
| 146 |
|
$command = 'restart'; |
| 147 |
|
|
| 148 |
|
if ($timeout != 10) { |
| 149 |
|
$command .= ' --timeout='.$timeout; |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
return $this->processResult( |
| 153 |
|
$this->execute( |
| 154 |
|
$this->formatCommand($command, $this->createComposeFileCollection($composeFiles)) |
| 155 |
|
) |
| 156 |
|
); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
/** |
| 160 |
|
* Run service with command |
|
@@ 199-208 (lines=10) @@
|
| 196 |
|
* |
| 197 |
|
* @param mixed $composeFiles The compose files names |
| 198 |
|
*/ |
| 199 |
|
public function ips($composeFiles = array()) |
| 200 |
|
{ |
| 201 |
|
$command = $this->formatCommand('ps', $this->createComposeFileCollection($composeFiles)); |
| 202 |
|
|
| 203 |
|
$command = 'for CONTAINER in $(' . $command . ' -q); '; |
| 204 |
|
$command .= 'do echo "$(docker inspect --format \' {{ .Name }} \' $CONTAINER)\t'; |
| 205 |
|
$command .= '$(docker inspect --format \' {{ .NetworkSettings.IPAddress }} \' $CONTAINER)"; done'; |
| 206 |
|
|
| 207 |
|
return $this->processResult($this->execute($command)); |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
/** |
| 211 |
|
* Process result with returned code and output |