Don't perform external setkey when net==host
| ... | ... |
@@ -48,10 +48,11 @@ func (daemon *Daemon) buildSandboxOptions(container *container.Container, n libn |
| 48 | 48 |
sboxOptions = append(sboxOptions, libnetwork.OptionUseDefaultSandbox()) |
| 49 | 49 |
sboxOptions = append(sboxOptions, libnetwork.OptionOriginHostsPath("/etc/hosts"))
|
| 50 | 50 |
sboxOptions = append(sboxOptions, libnetwork.OptionOriginResolvConfPath("/etc/resolv.conf"))
|
| 51 |
+ } else {
|
|
| 52 |
+ // OptionUseExternalKey is mandatory for userns support. |
|
| 53 |
+ // But optional for non-userns support |
|
| 54 |
+ sboxOptions = append(sboxOptions, libnetwork.OptionUseExternalKey()) |
|
| 51 | 55 |
} |
| 52 |
- // OptionUseExternalKey is mandatory for userns support. |
|
| 53 |
- // But optional for non-userns support |
|
| 54 |
- sboxOptions = append(sboxOptions, libnetwork.OptionUseExternalKey()) |
|
| 55 | 56 |
|
| 56 | 57 |
container.HostsPath, err = container.GetRootResourcePath("hosts")
|
| 57 | 58 |
if err != nil {
|