mirror of https://github.com/docker/docs.git
Merge pull request #5068 from tianon/fix-abs-volume-check
Fix edge case in bind mount absolute path detection
This commit is contained in:
commit
1bcb9ce69e
|
@ -177,12 +177,8 @@ func createVolumes(container *Container) error {
|
|||
if bindMap, exists := binds[volPath]; exists {
|
||||
isBindMount = true
|
||||
srcPath = bindMap.SrcPath
|
||||
srcAbs, err := filepath.Abs(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if srcPath != srcAbs {
|
||||
return fmt.Errorf("%s should be an absolute path", srcPath)
|
||||
if !filepath.IsAbs(srcPath) {
|
||||
return fmt.Errorf("%s must be an absolute path", srcPath)
|
||||
}
|
||||
if strings.ToLower(bindMap.Mode) == "rw" {
|
||||
srcRW = true
|
||||
|
|
Loading…
Reference in New Issue