Skip to content

Commit

Permalink
docker: update socket location (#5961)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Santos <[email protected]>

Signed-off-by: Nick Santos <[email protected]>
  • Loading branch information
nicks authored Oct 22, 2022
1 parent adbbfb4 commit a1be613
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/docker/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,21 @@ func TestProvideClusterProduct(t *testing.T) {
BuildToKubeContexts: []string{"docker-desktop-me", "docker-desktop-me"},
},
},
{
env: clusterid.ProductDockerDesktop,
runtime: container.RuntimeDocker,
osEnv: map[string]string{
"DOCKER_HOST": "unix:///home/tilt/.docker/run/docker.sock",
},
expectedCluster: Env{
Client: hostClient{Host: "unix:///home/tilt/.docker/run/docker.sock"},
BuildToKubeContexts: []string{"docker-desktop-me"},
},
expectedLocal: Env{
Client: hostClient{Host: "unix:///home/tilt/.docker/run/docker.sock"},
BuildToKubeContexts: []string{"docker-desktop-me", "docker-desktop-me"},
},
},
{
env: clusterid.ProductRancherDesktop,
runtime: container.RuntimeDocker,
Expand Down
3 changes: 3 additions & 0 deletions internal/docker/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ func isDefaultHost(e Env) bool {
// Docker Desktop for Linux - socket is in ~/.docker/desktop/docker.sock
(strings.HasPrefix(host, "unix://") && strings.HasSuffix(host, "/.docker/desktop/docker.sock")) ||

// Docker Desktop for Mac 4.13+ - socket is in ~/.docker/run/docker.sock
(strings.HasPrefix(host, "unix://") && strings.HasSuffix(host, "/.docker/run/docker.sock")) ||

// Rancher Desktop without admin access on Linux/Mac is in ~/.rd/docker.sock
(strings.HasPrefix(host, "unix://") && strings.HasSuffix(host, "/.rd/docker.sock"))

Expand Down

0 comments on commit a1be613

Please sign in to comment.