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:
parent
3111aa7293
commit
6c56f917d3
1 changed files with 5 additions and 2 deletions
|
@ -1084,10 +1084,13 @@ 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) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if hostConfig == nil {
|
||||
return nil, nil
|
||||
|
|
Loading…
Reference in a new issue