1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Windows: Ensure workdir handled in platform semantics

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2015-09-01 18:50:41 -07:00
parent 3111aa7293
commit 6c56f917d3

View file

@ -1084,8 +1084,11 @@ func (daemon *Daemon) verifyContainerSettings(hostConfig *runconfig.HostConfig,
// First perform verification of settings common across all platforms.
if config != nil {
if config.WorkingDir != "" && !system.IsAbs(config.WorkingDir) {
return nil, fmt.Errorf("The working directory '%s' is invalid. It needs to be an absolute path.", config.WorkingDir)
if config.WorkingDir != "" {
config.WorkingDir = filepath.FromSlash(config.WorkingDir) // Ensure in platform semantics
if !system.IsAbs(config.WorkingDir) {
return nil, fmt.Errorf("The working directory '%s' is invalid. It needs to be an absolute path.", config.WorkingDir)
}
}
}