Skip to content

Commit ed15f1d

Browse files
committed
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 <[email protected]>
1 parent 4f9c865 commit ed15f1d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

daemon/oci_linux.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,7 @@ func WithNamespaces(daemon *Daemon, c *container.Container) coci.SpecOpts {
285285
})
286286
}
287287
case networkMode.IsHost():
288-
setNamespace(s, specs.LinuxNamespace{
289-
Type: specs.NetworkNamespace,
290-
Path: c.NetworkSettings.SandboxKey,
291-
})
288+
oci.RemoveNamespace(s, specs.NetworkNamespace)
292289
default:
293290
setNamespace(s, specs.LinuxNamespace{
294291
Type: specs.NetworkNamespace,

0 commit comments

Comments
 (0)