mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
Force abs paths for host volumes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
@@ -172,6 +172,13 @@ 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 strings.ToLower(bindMap.Mode) == "rw" {
|
||||
srcRW = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user