mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
fix adding containers to the host network
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
eaabc8e4b0
commit
5f63e90922
1 changed files with 25 additions and 23 deletions
|
|
@ -363,6 +363,8 @@ class DockerActionManager
|
||||||
foreach($container->GetPorts()->GetPorts() as $value) {
|
foreach($container->GetPorts()->GetPorts() as $value) {
|
||||||
$exposedPorts[$value->port] = null;
|
$exposedPorts[$value->port] = null;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$requestBody['HostConfig']['NetworkMode'] = 'host';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($exposedPorts) > 0) {
|
if(count($exposedPorts) > 0) {
|
||||||
|
|
@ -633,8 +635,9 @@ class DockerActionManager
|
||||||
private function ConnectContainerIdToNetwork(string $id, string $internalPort) : void
|
private function ConnectContainerIdToNetwork(string $id, string $internalPort) : void
|
||||||
{
|
{
|
||||||
if ($internalPort === 'host') {
|
if ($internalPort === 'host') {
|
||||||
$network = 'host';
|
return;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
$network = 'nextcloud-aio';
|
$network = 'nextcloud-aio';
|
||||||
$url = $this->BuildApiUrl('networks/create');
|
$url = $this->BuildApiUrl('networks/create');
|
||||||
try {
|
try {
|
||||||
|
|
@ -659,7 +662,6 @@ class DockerActionManager
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$url = $this->BuildApiUrl(
|
$url = $this->BuildApiUrl(
|
||||||
sprintf('networks/%s/connect', $network)
|
sprintf('networks/%s/connect', $network)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue