1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

Merge pull request #5832 from vvoland/swarm-fix-image-subpath

cli/compose: Fix Image Subpath
This commit is contained in:
Sebastiaan van Stijn
2025-02-17 12:53:34 +01:00
committed by GitHub
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

View File

@@ -415,7 +415,7 @@ type ServiceVolumeVolume struct {
// ServiceVolumeImage are options for a service volume of type image
type ServiceVolumeImage struct {
Subpath bool `mapstructure:"subpath" yaml:"subpath,omitempty" json:"subpath,omitempty"`
Subpath string `mapstructure:"subpath" yaml:"subpath,omitempty" json:"subpath,omitempty"`
}
// ServiceVolumeTmpfs are options for a service volume of type tmpfs