From 0449100e23e85e199af00f8c3d65e5966144a661 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:56:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20host=20=E7=BD=91=E7=BB=9C=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#2582)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #2550 --- backend/app/service/container.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app/service/container.go b/backend/app/service/container.go index a3f1244d6..2f2070b5e 100644 --- a/backend/app/service/container.go +++ b/backend/app/service/container.go @@ -867,6 +867,10 @@ func loadConfigInfo(isCreate bool, req dto.ContainerOperate, oldContainer *types config.Tty = req.Tty if len(req.Network) != 0 { + switch req.Network { + case "host", "none", "bridge": + hostConf.NetworkMode = container.NetworkMode(req.Network) + } networkConf.EndpointsConfig = map[string]*network.EndpointSettings{req.Network: {}} } else { networkConf = network.NetworkingConfig{}