From 97b0a9d5f195c7daf16cf9dcfb6c4d62044163fe Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 4 Dec 2017 14:17:30 -0500 Subject: [PATCH] Fix nonewmountns for containerd options Signed-off-by: Michael Crosby --- cmd/dockerd/daemon_unix.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/cmd/dockerd/daemon_unix.go b/cmd/dockerd/daemon_unix.go index 41e6b61ffa..a65d8ed012 100644 --- a/cmd/dockerd/daemon_unix.go +++ b/cmd/dockerd/daemon_unix.go @@ -14,7 +14,6 @@ import ( "github.com/docker/docker/cmd/dockerd/hack" "github.com/docker/docker/daemon" "github.com/docker/docker/libcontainerd" - "github.com/docker/docker/pkg/parsers/kernel" "github.com/docker/libnetwork/portallocator" "golang.org/x/sys/unix" ) @@ -38,24 +37,13 @@ func getDaemonConfDir(_ string) string { } func (cli *DaemonCli) getPlatformRemoteOptions() ([]libcontainerd.RemoteOption, error) { - // On older kernel, letting putting the containerd-shim in its own - // namespace will effectively prevent operations such as unlink, rename - // and remove on mountpoints that were present at the time the shim - // namespace was created. This would led to a famous EBUSY will trying to - // remove shm mounts. - var noNewNS bool - if !kernel.CheckKernelVersion(3, 18, 0) { - noNewNS = true - } - opts := []libcontainerd.RemoteOption{ libcontainerd.WithOOMScore(cli.Config.OOMScoreAdjust), libcontainerd.WithPlugin("linux", &linux.Config{ - Shim: daemon.DefaultShimBinary, - Runtime: daemon.DefaultRuntimeBinary, - RuntimeRoot: filepath.Join(cli.Config.Root, "runc"), - ShimDebug: cli.Config.Debug, - ShimNoMountNS: noNewNS, + Shim: daemon.DefaultShimBinary, + Runtime: daemon.DefaultRuntimeBinary, + RuntimeRoot: filepath.Join(cli.Config.Root, "runc"), + ShimDebug: cli.Config.Debug, }), } if cli.Config.Debug {