Explicity set Cgroup NS mode to "host" when running privileged
@@ -361,12 +361,16 @@ func (daemon *Daemon) adaptContainerSettings(hostConfig *containertypes.HostConf
// Set default cgroup namespace mode, if unset for container
if hostConfig.CgroupnsMode.IsEmpty() {
+ if hostConfig.Privileged {
+ hostConfig.CgroupnsMode = containertypes.CgroupnsMode("host")
+ } else {
m := config.DefaultCgroupNamespaceMode
if daemon.configStore != nil {
m = daemon.configStore.CgroupNamespaceMode
}
hostConfig.CgroupnsMode = containertypes.CgroupnsMode(m)
}
+ }
adaptSharedNamespaceContainer(daemon, hostConfig)
