Skip to content

Commit

Permalink
fix: block root-less socket mount for docker engine (#3164)
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge authored Feb 19, 2025
1 parent 29e2415 commit 240c73c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,14 @@ EOF
case "unix":
if dindHost, err = client.ParseHostURL(client.DefaultDockerHost); err != nil {
return errors.Errorf("failed to parse default host: %w", err)
} else if strings.HasSuffix(parsed.Host, "/.docker/run/docker.sock") {
fmt.Fprintln(os.Stderr, utils.Yellow("WARNING:"), "analytics requires mounting default docker socket:", dindHost.Host)
binds = append(binds, fmt.Sprintf("%[1]s:%[1]s:ro", dindHost.Host))
} else {
// Podman and OrbStack can mount root-less socket without issue
binds = append(binds, fmt.Sprintf("%s:%s:ro", parsed.Host, dindHost.Host))
securityOpts = append(securityOpts, "label:disable")
}
binds = append(binds, fmt.Sprintf("%s:%s:ro", parsed.Host, dindHost.Host))
securityOpts = append(securityOpts, "label:disable")
}
if _, err := utils.DockerStart(
ctx,
Expand Down

0 comments on commit 240c73c

Please # to comment.