fix docker compose volumes readonly.

This commit is contained in:
Miroslav Šedivý
2023-10-01 23:39:35 +02:00
parent 3d95cb41e2
commit 4b1b32dd62
+4 -4
View File
@@ -205,11 +205,11 @@ func (manager *RoomManagerCtx) ExportAsDockerCompose() ([]byte, error) {
// volumes
volumes := []string{}
for _, mount := range containerJson.Mounts {
if mount.RW {
volumes = append(volumes, fmt.Sprintf("%s:%s:ro", mount.Source, mount.Destination))
for _, mount := range containerJson.HostConfig.Mounts {
if mount.ReadOnly {
volumes = append(volumes, fmt.Sprintf("%s:%s:ro", mount.Source, mount.Target))
} else {
volumes = append(volumes, fmt.Sprintf("%s:%s", mount.Source, mount.Destination))
volumes = append(volumes, fmt.Sprintf("%s:%s", mount.Source, mount.Target))
}
}
if len(volumes) > 0 {