diff --git a/opts/mount.go b/opts/mount.go index 3aa9849421ac..309e89b6fd9f 100644 --- a/opts/mount.go +++ b/opts/mount.go @@ -4,6 +4,7 @@ import ( "encoding/csv" "fmt" "os" + "path/filepath" "strconv" "strings" @@ -88,7 +89,10 @@ func (m *MountOpt) Set(value string) error { case "type": mount.Type = mounttypes.Type(strings.ToLower(value)) case "source", "src": - mount.Source = value + mount.Source, err = filepath.Abs(value) + if err != nil { + mount.Source = value + } case "target", "dst", "destination": mount.Target = value case "readonly", "ro":