From ed15f1d7179caa7b82b15bbeb55adb19546245d2 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 18 Jan 2024 18:05:27 +0900 Subject: [PATCH] net=host: remove /var/run/docker/netns/default from OCI config Prior to this commit, a container running with `--net=host` had `{"type":"network","path":"/var/run/docker/netns/default"}` in the ``.linux.namespaces` field of the OCI Runtime Config, but this wasn't needed. Close issue 47100 Signed-off-by: Akihiro Suda --- daemon/oci_linux.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index 942d094093f39..c7fdedcb31f10 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -285,10 +285,7 @@ func WithNamespaces(daemon *Daemon, c *container.Container) coci.SpecOpts { }) } case networkMode.IsHost(): - setNamespace(s, specs.LinuxNamespace{ - Type: specs.NetworkNamespace, - Path: c.NetworkSettings.SandboxKey, - }) + oci.RemoveNamespace(s, specs.NetworkNamespace) default: setNamespace(s, specs.LinuxNamespace{ Type: specs.NetworkNamespace,