Skip to content

Commit

Permalink
history: handle wsl socket path
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Mar 7, 2025
1 parent cadf4a5 commit c3d59b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions util/desktop/paths_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ import (
)

const (
socketName = "docker-desktop-build.sock"
socketPath = ".docker/desktop"
socketName = "docker-desktop-build.sock"
socketPath = ".docker/desktop"
wslSocketPath = "/mnt/wsl/docker-desktop/shared-sockets/host-services"
)

func BuildServerAddr() (string, error) {
if os.Getenv("WSL_DISTRO_NAME") != "" {
return "unix://" + filepath.Join(wslSocketPath, socketName), nil
}
dir, err := os.UserHomeDir()
if err != nil {
return "", errors.Wrap(err, "failed to get user home directory")
Expand Down

0 comments on commit c3d59b4

Please sign in to comment.