mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
Merge pull request #1655 from nextcloud/enh/noid/fix-adding-containers-to-host-network
fix adding containers to the host network
This commit is contained in:
commit
cd06678191
1 changed files with 25 additions and 23 deletions
|
|
@ -364,6 +364,8 @@ class DockerActionManager
|
|||
$portWithProtocol = $value->port . '/' . $value->protocol;
|
||||
$exposedPorts[$portWithProtocol] = null;
|
||||
}
|
||||
} else {
|
||||
$requestBody['HostConfig']['NetworkMode'] = 'host';
|
||||
}
|
||||
|
||||
if(count($exposedPorts) > 0) {
|
||||
|
|
@ -621,8 +623,9 @@ class DockerActionManager
|
|||
private function ConnectContainerIdToNetwork(string $id, string $internalPort) : void
|
||||
{
|
||||
if ($internalPort === 'host') {
|
||||
$network = 'host';
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$network = 'nextcloud-aio';
|
||||
$url = $this->BuildApiUrl('networks/create');
|
||||
try {
|
||||
|
|
@ -647,7 +650,6 @@ class DockerActionManager
|
|||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$url = $this->BuildApiUrl(
|
||||
sprintf('networks/%s/connect', $network)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue