Skip to content

Commit 7071ee1

Browse files
committed
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)).
1 parent 3f70e5a commit 7071ee1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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)