diff --git a/cli/compose/loader/merge.go b/cli/compose/loader/merge.go index e72b6d5e30..b48d3452b9 100644 --- a/cli/compose/loader/merge.go +++ b/cli/compose/loader/merge.go @@ -126,7 +126,9 @@ func toServiceVolumeConfigsMap(s interface{}) (map[interface{}]interface{}, erro } m := map[interface{}]interface{}{} for _, v := range volumes { - m[v.Target] = v + if _, exists := m[v.Target]; !exists { + m[v.Target] = v + } } return m, nil }