mirror of https://github.com/docker/docs.git
Merge pull request #3152 from daniel-garcia/3129_dont-open-bindmounted-files
don't open bind mounted files/dirs to get Stat, use os.Lstat
This commit is contained in:
commit
4c6e528f13
|
@ -801,16 +801,11 @@ func (container *Container) createVolumes() error {
|
||||||
if strings.ToLower(bindMap.Mode) == "rw" {
|
if strings.ToLower(bindMap.Mode) == "rw" {
|
||||||
srcRW = true
|
srcRW = true
|
||||||
}
|
}
|
||||||
if file, err := os.Open(bindMap.SrcPath); err != nil {
|
if stat, err := os.Lstat(bindMap.SrcPath); err != nil {
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
defer file.Close()
|
|
||||||
if stat, err := file.Stat(); err != nil {
|
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
volIsDir = stat.IsDir()
|
volIsDir = stat.IsDir()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Otherwise create an directory in $ROOT/volumes/ and use that
|
// Otherwise create an directory in $ROOT/volumes/ and use that
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue