Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions pkg/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.
}
}

bind, vol, tmpfs := buildMountOptions(project, volume)
bind, vol, tmpfs := buildMountOptions(volume)

volume.Target = path.Clean(volume.Target)

Expand All @@ -1087,7 +1087,7 @@ func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.
}, nil
}

func buildMountOptions(project types.Project, volume types.ServiceVolumeConfig) (*mount.BindOptions, *mount.VolumeOptions, *mount.TmpfsOptions) {
func buildMountOptions(volume types.ServiceVolumeConfig) (*mount.BindOptions, *mount.VolumeOptions, *mount.TmpfsOptions) {
switch volume.Type {
case "bind":
if volume.Volume != nil {
Expand All @@ -1104,11 +1104,6 @@ func buildMountOptions(project types.Project, volume types.ServiceVolumeConfig)
if volume.Tmpfs != nil {
logrus.Warnf("mount of type `volume` should not define `tmpfs` option")
}
if v, ok := project.Volumes[volume.Source]; ok && v.DriverOpts["o"] == types.VolumeTypeBind {
return buildBindOption(&types.ServiceVolumeBind{
CreateHostPath: true,
}), nil, nil
}
return nil, buildVolumeOptions(volume.Volume), nil
case "tmpfs":
if volume.Bind != nil {
Expand Down