Skip to content

Commit 246be84

Browse files
unlairavallete
andauthored
fix: use correct docker.sock binding with vector (fixes #3127, #3512, #3593) (#4791)
fix: use correct docker.sock binding when starting vector img (fixes #3127, #3512, #3593) This fixes Docker Desktop on Linux failing to start the vector container. The container tries to bind to the Docker Desktop socket directly, which is unsupported. The host binding path should always be /var/run/docker.sock, which has special handling under the hood (see docker/for-mac#6545 (comment)). Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
1 parent 05d65b6 commit 246be84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/start/start.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,10 @@ EOF
378378
case "unix":
379379
if dindHost, err = client.ParseHostURL(client.DefaultDockerHost); err != nil {
380380
return errors.Errorf("failed to parse default host: %w", err)
381-
} else if strings.HasSuffix(parsed.Host, "/.docker/run/docker.sock") {
382-
fmt.Fprintln(os.Stderr, utils.Yellow("WARNING:"), "analytics requires mounting default docker socket:", dindHost.Host)
381+
} else if strings.HasSuffix(parsed.Host, "/.docker/run/docker.sock") ||
382+
strings.HasSuffix(parsed.Host, "/.docker/desktop/docker.sock") {
383+
// Docker will not mount rootless socket directly;
384+
// instead, specify root socket to have it handled under the hood
383385
binds = append(binds, fmt.Sprintf("%[1]s:%[1]s:ro", dindHost.Host))
384386
} else {
385387
// Podman and OrbStack can mount root-less socket without issue

0 commit comments

Comments
 (0)