Suppress Docker PHP error if container has no ports exposed or utilized

This commit is contained in:
Squidly271
2018-04-23 20:08:30 -04:00
committed by GitHub
parent 1a51938381
commit 75ee98a201

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 ];