mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
do not mount duplicate mounts.
This commit is contained in:
@@ -245,8 +245,14 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
||||
}
|
||||
}
|
||||
|
||||
paths := map[string]bool{}
|
||||
mounts := []dockerMount.Mount{}
|
||||
for _, mount := range settings.Mounts {
|
||||
// ignore duplicates
|
||||
if _, ok := paths[mount.ContainerPath]; ok {
|
||||
continue
|
||||
}
|
||||
|
||||
readOnly := false
|
||||
|
||||
hostPath := filepath.Clean(mount.HostPath)
|
||||
@@ -309,6 +315,8 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
paths[mount.ContainerPath] = true
|
||||
}
|
||||
|
||||
config := &container.Config{
|
||||
|
||||
Reference in New Issue
Block a user