From c83f1285a88f5b772b32969285ad9e0b6c6867db Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 10 Apr 2025 18:46:35 +0200 Subject: [PATCH] use bind API for bind mounts Signed-off-by: Nicolas De Loof --- pkg/compose/create.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/compose/create.go b/pkg/compose/create.go index 999b50f43..1f979f5b2 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -862,11 +862,12 @@ func (s *composeService) buildContainerVolumes( v.Source = m.Source fallthrough case !requireMountAPI(v.Bind): - vol := findVolumeByName(p.Volumes, m.Source) - if vol != nil { - binds = append(binds, toBindString(vol.Name, v)) - continue + source := m.Source + if vol := findVolumeByName(p.Volumes, m.Source); vol != nil { + source = m.Source } + binds = append(binds, toBindString(source, v)) + continue } } case mount.TypeVolume: