mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #25771 from mrunalp/allow_host_ns_with_user
Allow using --pid=host and --net=host when --userns=host
This commit is contained in:
commit
3473980a29
1 changed files with 2 additions and 2 deletions
|
@ -487,10 +487,10 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
|
|||
if hostConfig.Privileged {
|
||||
return warnings, fmt.Errorf("Privileged mode is incompatible with user namespaces")
|
||||
}
|
||||
if hostConfig.NetworkMode.IsHost() {
|
||||
if hostConfig.NetworkMode.IsHost() && !hostConfig.UsernsMode.IsHost() {
|
||||
return warnings, fmt.Errorf("Cannot share the host's network namespace when user namespaces are enabled")
|
||||
}
|
||||
if hostConfig.PidMode.IsHost() {
|
||||
if hostConfig.PidMode.IsHost() && !hostConfig.UsernsMode.IsHost() {
|
||||
return warnings, fmt.Errorf("Cannot share the host PID namespace when user namespaces are enabled")
|
||||
}
|
||||
if hostConfig.ReadonlyRootfs {
|
||||
|
|
Loading…
Add table
Reference in a new issue