Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: recognize docker desktop for linux socket location #5823

Merged
merged 1 commit into from
May 17, 2022

Conversation

nicksieger
Copy link
Member

Fixes #5812.

@nicksieger nicksieger requested a review from nicks May 17, 2022 18:33
host == "unix:///var/run/docker.sock" ||

// Docker Desktop for Linux - socket is in ~/.docker/desktop/docker.sock
ddLinux.Match([]byte(host))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MatchString would be more idiomatic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks.

@@ -284,6 +285,8 @@ func isOldMinikube(ctx context.Context, minikubeClient k8s.MinikubeClient) bool
return minMinikubeVersionBuildkit.GTE(vParsed)
}

var ddLinux *regexp.Regexp = regexp.MustCompile(`^unix:///home/[^/]+/.docker/desktop/docker.sock$`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we be a bit more permissive here? e.g., unix:///.*/.docker/desktop/docker.sock?

i have definitely worked on unix systems where the home directories did not match this regexp, and the relevant manuals note that we shouldn't be assuming they're laid out this way (cf https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s08.html)

Copy link
Member Author

@nicksieger nicksieger May 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, switched to checking prefix unix:// and suffix /.docker/desktop/docker.sock

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nicksieger nicksieger merged commit 6f355da into master May 17, 2022
@nicksieger nicksieger deleted the nicksieger/5812 branch May 17, 2022 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tilt fails to detect Docker Desktop for Linux and attempts to push images
2 participants