From 6952135fc8004f669c962c5989fd2e5a05bb2510 Mon Sep 17 00:00:00 2001 From: John Howard Date: Thu, 26 May 2016 13:24:22 -0700 Subject: [PATCH] Windows: Default isolation and workdir Signed-off-by: John Howard --- container/container.go | 4 ++-- daemon/create_windows.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/container/container.go b/container/container.go index 6547a4ea0b..6f51ce0dbc 100644 --- a/container/container.go +++ b/container/container.go @@ -207,14 +207,14 @@ func (container *Container) SetupWorkingDirectory(rootUID, rootGID int) error { return nil } + container.Config.WorkingDir = filepath.Clean(container.Config.WorkingDir) + // If can't mount container FS at this point (eg Hyper-V Containers on // Windows) bail out now with no action. if !container.canMountFS() { return nil } - container.Config.WorkingDir = filepath.Clean(container.Config.WorkingDir) - pth, err := container.GetResourcePath(container.Config.WorkingDir) if err != nil { return err diff --git a/daemon/create_windows.go b/daemon/create_windows.go index 6aabddad5e..d4da759fd3 100644 --- a/daemon/create_windows.go +++ b/daemon/create_windows.go @@ -11,6 +11,11 @@ import ( // createContainerPlatformSpecificSettings performs platform specific container create functionality func (daemon *Daemon) createContainerPlatformSpecificSettings(container *container.Container, config *containertypes.Config, hostConfig *containertypes.HostConfig) error { + // Make sure the host config has the default daemon isolation if not specified by caller. + if containertypes.Isolation.IsDefault(containertypes.Isolation(hostConfig.Isolation)) { + hostConfig.Isolation = daemon.defaultIsolation + } + for spec := range config.Volumes { mp, err := volume.ParseMountSpec(spec, hostConfig.VolumeDriver)