diff --git a/pkg/compose/create.go b/pkg/compose/create.go index f4178d6af7..e7626830ce 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -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) @@ -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 { @@ -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 {