From 1771d35b4852be197c90c19ba5aada940e133c2b Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Wed, 6 Apr 2016 16:45:43 -0400 Subject: [PATCH] Don't perform external setkey when net==host This else case was lost in the migration from native execdriver to OCI implementation via runc. There is no need to have external setkey when --net=host. Docker-DCO-1.1-Signed-off-by: Phil Estes --- daemon/container_operations.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon/container_operations.go b/daemon/container_operations.go index 310f9bb497..b6419557f3 100644 --- a/daemon/container_operations.go +++ b/daemon/container_operations.go @@ -48,10 +48,11 @@ func (daemon *Daemon) buildSandboxOptions(container *container.Container, n libn sboxOptions = append(sboxOptions, libnetwork.OptionUseDefaultSandbox()) sboxOptions = append(sboxOptions, libnetwork.OptionOriginHostsPath("/etc/hosts")) sboxOptions = append(sboxOptions, libnetwork.OptionOriginResolvConfPath("/etc/resolv.conf")) + } else { + // OptionUseExternalKey is mandatory for userns support. + // But optional for non-userns support + sboxOptions = append(sboxOptions, libnetwork.OptionUseExternalKey()) } - // OptionUseExternalKey is mandatory for userns support. - // But optional for non-userns support - sboxOptions = append(sboxOptions, libnetwork.OptionUseExternalKey()) container.HostsPath, err = container.GetRootResourcePath("hosts") if err != nil {