@@ 85-98 (lines=14) @@ | ||
82 | * @param mixed $composeFiles The compose files names |
|
83 | * @param string $signal Optionnal to precise SIGNAL to send to the container for SIGKILL replacement. |
|
84 | */ |
|
85 | public function kill($composeFiles = array(), $signal = 'SIGKILL') |
|
86 | { |
|
87 | $command = 'kill'; |
|
88 | ||
89 | if ($signal !== 'SIGKILL') { |
|
90 | $command .= ' -s ' . $signal; |
|
91 | } |
|
92 | ||
93 | return $this->processResult( |
|
94 | $this->execute( |
|
95 | $this->formatCommand($command, $this->createComposeFileCollection($composeFiles)) |
|
96 | ) |
|
97 | ); |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * Down service containers |
|
@@ 203-216 (lines=14) @@ | ||
200 | * @param mixed $composeFiles The compose files names |
|
201 | * @param integer $timeout If we want attempt to pull a newer version of the from image |
|
202 | */ |
|
203 | public function restart($composeFiles = array(), $timeout = 10) |
|
204 | { |
|
205 | $command = 'restart'; |
|
206 | ||
207 | if ($timeout != 10) { |
|
208 | $command .= ' --timeout='.$timeout; |
|
209 | } |
|
210 | ||
211 | return $this->processResult( |
|
212 | $this->execute( |
|
213 | $this->formatCommand($command, $this->createComposeFileCollection($composeFiles)) |
|
214 | ) |
|
215 | ); |
|
216 | } |
|
217 | ||
218 | /** |
|
219 | * Run service with command |
|
@@ 273-282 (lines=10) @@ | ||
270 | * |
|
271 | * @param mixed $composeFiles The compose files names |
|
272 | */ |
|
273 | public function ips($composeFiles = array()) |
|
274 | { |
|
275 | $command = $this->formatCommand('ps', $this->createComposeFileCollection($composeFiles)); |
|
276 | ||
277 | $command = 'for CONTAINER in $(' . $command . ' -q); '; |
|
278 | $command .= 'do echo "$(docker inspect --format \' {{ .Name }} \' $CONTAINER)\t'; |
|
279 | $command .= '$(docker inspect --format \' {{ .NetworkSettings.IPAddress }} \' $CONTAINER)"; done'; |
|
280 | ||
281 | return $this->processResult($this->execute($command)); |
|
282 | } |
|
283 | ||
284 | /** |
|
285 | * Process result with returned code and output |