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