diff --git a/cli/compose/convert/volume.go b/cli/compose/convert/volume.go index e7dc989b2a..8787ea317c 100644 --- a/cli/compose/convert/volume.go +++ b/cli/compose/convert/volume.go @@ -67,6 +67,7 @@ func handleVolumeToMount( if volume.Volume != nil { result.VolumeOptions.NoCopy = volume.Volume.NoCopy + result.VolumeOptions.Subpath = volume.Volume.Subpath } if stackVolume.Name != "" { diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index 207ce89e06..1377a79554 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -410,7 +410,8 @@ type ServiceVolumeBind struct { // ServiceVolumeVolume are options for a service volume of type volume type ServiceVolumeVolume struct { - NoCopy bool `mapstructure:"nocopy" yaml:"nocopy,omitempty" json:"nocopy,omitempty"` + NoCopy bool `mapstructure:"nocopy" yaml:"nocopy,omitempty" json:"nocopy,omitempty"` + Subpath string `mapstructure:"subpath" yaml:"subpath,omitempty" json:"subpath,omitempty"` } // ServiceVolumeImage are options for a service volume of type image