Windows: Default isolation and workdir

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2016-05-26 13:24:22 -07:00
parent ff3dc48966
commit 6952135fc8
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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)