mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Explicity set Cgroup NS mode to "host" when running privileged
Signed-off-by: Rob Gulewich <rgulewich@netflix.com>
This commit is contained in:
parent
96f6c81ab7
commit
530f2d65c3
1 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue