Skip to content

Commit 646ca60

Browse files
committed
avoid duplicate mounts
1 parent 0dceab2 commit 646ca60

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/docker.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,13 @@ func runDockerCVM(ctx context.Context, log slog.Logger, client dockerutil.Client
628628
strings.TrimPrefix(mountpoint, strings.TrimSuffix(flags.hostUsrLibDir, "/")),
629629
)
630630
}
631+
// Avoid duplicate mounts.
632+
if slices.ContainsFunc(mounts, func(m xunix.Mount) bool {
633+
return m.Mountpoint == mountpoint
634+
}) {
635+
log.Debug(ctx, "skipping duplicate mount", slog.F("path", mountpoint))
636+
continue
637+
}
631638
mounts = append(mounts, xunix.Mount{
632639
Source: bind.Path,
633640
Mountpoint: mountpoint,

0 commit comments

Comments
 (0)