Merge pull request #333 from Squidly271/patch-1

Suppress Docker PHP error if container has no ports exposed or utilized
This commit is contained in:
tom mortensen
2018-04-25 16:07:58 -07:00
committed by GitHub

View File

@@ -710,6 +710,7 @@ class DockerClient {
$nat = false;
}
$ip = $ct['NetworkSettings']['Networks'][$c['NetworkMode']]['IPAddress'];
$ports = is_array($ports) ? $ports : array();
foreach ($ports as $port => $value) {
list($PrivatePort, $Type) = explode('/', $port);
$c['Ports'][] = ['IP' => $ip, 'PrivatePort' => $PrivatePort, 'PublicPort' => $nat ? $value[0]['HostPort']:$PrivatePort, 'NAT' => $nat, 'Type' => $Type ];