Skip to content

Commit

Permalink
net=host: remove /var/run/docker/netns/default from OCI config
Browse files Browse the repository at this point in the history
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 <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jan 18, 2024
1 parent 4f9c865 commit ed15f1d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions daemon/oci_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ed15f1d

Please sign in to comment.