mirror of https://github.com/docker/cli.git
Fix not to assign a value to toBind
Signed-off-by: Seiya Miyata <odradek38@gmail.com>
This commit is contained in:
parent
935df5a59f
commit
cac48f1ec6
|
@ -360,13 +360,12 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
|
|||
toBind := bind
|
||||
|
||||
if parsed.Type == string(mounttypes.TypeBind) {
|
||||
if hostPart, targetPath, ok := strings.Cut(bind, ":"); ok {
|
||||
if hostPart, _, ok := strings.Cut(bind, ":"); ok {
|
||||
if strings.HasPrefix(hostPart, "."+string(filepath.Separator)) || hostPart == "." {
|
||||
if absHostPart, err := filepath.Abs(hostPart); err == nil {
|
||||
hostPart = absHostPart
|
||||
}
|
||||
}
|
||||
toBind = hostPart + ":" + targetPath
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue