1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix nonewmountns for containerd options

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-12-04 14:17:30 -05:00
parent ad2b34f205
commit 97b0a9d5f1

View file

@ -14,7 +14,6 @@ import (
"github.com/docker/docker/cmd/dockerd/hack" "github.com/docker/docker/cmd/dockerd/hack"
"github.com/docker/docker/daemon" "github.com/docker/docker/daemon"
"github.com/docker/docker/libcontainerd" "github.com/docker/docker/libcontainerd"
"github.com/docker/docker/pkg/parsers/kernel"
"github.com/docker/libnetwork/portallocator" "github.com/docker/libnetwork/portallocator"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
@ -38,16 +37,6 @@ func getDaemonConfDir(_ string) string {
} }
func (cli *DaemonCli) getPlatformRemoteOptions() ([]libcontainerd.RemoteOption, error) { 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{ opts := []libcontainerd.RemoteOption{
libcontainerd.WithOOMScore(cli.Config.OOMScoreAdjust), libcontainerd.WithOOMScore(cli.Config.OOMScoreAdjust),
libcontainerd.WithPlugin("linux", &linux.Config{ libcontainerd.WithPlugin("linux", &linux.Config{
@ -55,7 +44,6 @@ func (cli *DaemonCli) getPlatformRemoteOptions() ([]libcontainerd.RemoteOption,
Runtime: daemon.DefaultRuntimeBinary, Runtime: daemon.DefaultRuntimeBinary,
RuntimeRoot: filepath.Join(cli.Config.Root, "runc"), RuntimeRoot: filepath.Join(cli.Config.Root, "runc"),
ShimDebug: cli.Config.Debug, ShimDebug: cli.Config.Debug,
ShimNoMountNS: noNewNS,
}), }),
} }
if cli.Config.Debug { if cli.Config.Debug {