Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit d16a5f4

Browse files
authoredMay 24, 2021
Merge pull request #1704 from gtardif/fix_win_mount_socket
2 parents 003d61f + 7a25378 commit d16a5f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎local/compose/create.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,9 @@ func isUnixAbs(path string) bool {
774774

775775
func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.Mount, error) {
776776
source := volume.Source
777-
if volume.Type == types.VolumeTypeBind && !filepath.IsAbs(source) {
777+
// on windows, filepath.IsAbs(source) is false for unix style abs path like /var/run/docker.sock.
778+
// do not replace these with filepath.Abs(source) that will include a default drive.
779+
if volume.Type == types.VolumeTypeBind && !filepath.IsAbs(source) && !strings.HasPrefix(source, "/") {
778780
// volume source has already been prefixed with workdir if required, by compose-go project loader
779781
var err error
780782
source, err = filepath.Abs(source)

0 commit comments

Comments
 (0)