cli/compose: Fix Image Subpath

handleImageToMount was an exact copy of handleBindToMount instead of
populating the ImageOptions.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-02-17 12:35:28 +01:00
parent c542ad7443
commit 4cc2dce807
2 changed files with 4 additions and 4 deletions

View File

@ -107,9 +107,9 @@ func handleImageToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, e
if volume.Cluster != nil {
return mount.Mount{}, errors.New("cluster options are incompatible with type image")
}
if volume.Bind != nil {
result.BindOptions = &mount.BindOptions{
Propagation: mount.Propagation(volume.Bind.Propagation),
if volume.Image != nil {
result.ImageOptions = &mount.ImageOptions{
Subpath: volume.Image.Subpath,
}
}
return result, nil