Skip to content

fix: use correct docker.sock binding with vector (fixes #3127, #3512, #3593) - #4791

Merged
avallete merged 2 commits into
supabase:developfrom
unlair:fix/3593-docker-socket-binding
Apr 2, 2026
Merged

avallete merged 2 commits into
supabase:developfrom
unlair:fix/3593-docker-socket-binding

Conversation

@unlair

@unlair unlair commented Feb 2, 2026 •

Copy link
Copy Markdown
Contributor

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. This fix resolves #3127, #3512, and #3593.

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

When using Docker Desktop on Linux, Vector fails to start when doing supabase start.

What is the new behavior?

When using Docker Desktop on Linux, Vector successfully starts when doing supabase start.

Additional context

Using Docker or Docker Desktop on Linux, the specified host binding path to the Docker socket should be /var/run/docker.sock, as that path has special handling under the hood (see docker/for-mac#6545 (comment)). Note that it does not directly use the socket sitting at /var/run/docker.sock on the host machine. My understanding is that what it ends up doing under the hood is essentially using what you get with /var/run/docker.sock.raw from outside Docker, as mentioned here: https://docs.docker.com/extensions/extensions-sdk/guides/use-docker-socket-from-backend/

@unlair
unlair requested a review from a team as a code owner February 2, 2026 22:36
@unlair
unlair force-pushed the fix/3593-docker-socket-binding branch 2 times, most recently from bc2752d to 7368ff6 Compare February 4, 2026 16:57
@coveralls

coveralls commented Feb 4, 2026 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23751202800

Details

  • 0 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 63.108%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/start/start.go 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
internal/storage/rm/rm.go 2 80.61%
internal/utils/git.go 5 57.14%
Totals Coverage Status
Change from base Build 23735607557: -0.03%
Covered Lines: 9203
Relevant Lines: 14583

💛 - Coveralls

@unlair
unlair force-pushed the fix/3593-docker-socket-binding branch from 7368ff6 to 3f2ce38 Compare February 15, 2026 04:20
@coderabbitai

coderabbitai Bot commented Feb 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f6de3856-fb4d-4ebe-aeea-aab3fb8d4c84

📥 Commits

Reviewing files that changed from the base of the PR and between 546a524 and 170baf3.

📒 Files selected for processing (1)
  • internal/start/start.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/start/start.go

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved Docker Desktop socket handling: both supported Docker Desktop socket locations are now recognized, unnecessary warning messages removed, and the socket is mounted read-only to the Docker daemon host to improve reliability and security.

Walkthrough

Expanded unix Docker socket handling to treat both /.docker/run/docker.sock and /.docker/desktop/docker.sock as root-socket cases. For these paths the code now appends a read-only bind to the Docker daemon host (dindHost.Host) and skips the previous warning path, preserving prior behavior for other socket cases (Podman/OrbStack path remains a read-only bind with a security label).

Sequence Diagram(s)

(omitted)

Assessment against linked issues

Objective Addressed Explanation
Add docker socket mount path config option to allow non-default socket locations (e.g., /run/user/1000/docker.sock) [#3127] ❌ No config.toml or runtime option was added to allow customizing the socket mount path.

Out-of-scope changes

Code Change Explanation
Treat Docker Desktop socket path as root-socket and bind-readonly (internal/start/start.go) This change modifies built-in handling for specific socket paths but does not implement the requested configurable socket path option.
🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR addresses the core requirement from #3593 by modifying docker.sock binding logic to use /var/run/docker.sock instead of the direct Docker Desktop socket path, resolving mount-denied failures.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to internal/start/start.go, modifying only the Docker socket binding logic to handle both /.docker/run/docker.sock and /.docker/desktop/docker.sock cases as required by #3593.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop
Title check ✅ Passed The title 'fix: use correct docker.sock binding with vector (fixes #3127, #3512, #3593)' directly and specifically describes the main change: correcting Docker socket binding for Vector containers on Docker Desktop.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@unlair
unlair force-pushed the fix/3593-docker-socket-binding branch from 3f2ce38 to 4ed5e3e Compare February 15, 2026 04:28
@unlair unlair changed the title fix: use correct docker.sock binding with vector (fixes #3593) fix: use correct docker.sock binding with vector (fixes #3127, #3512, #3593) Feb 15, 2026
@unlair
unlair force-pushed the fix/3593-docker-socket-binding branch from 4ed5e3e to 546a524 Compare February 28, 2026 01:49
@unlair

unlair commented Feb 28, 2026

Copy link
Copy Markdown
Contributor Author

@avallete @jgoux
I'd like to know how I can get these 3 PRs looked at, especially this one here. They solve some long-standing issues and are required for me to be able to use supabase-cli on Debian (I've been using my own fork in the meantime).

@unlair
unlair force-pushed the fix/3593-docker-socket-binding branch 2 times, most recently from 170baf3 to b829e30 Compare March 15, 2026 19:08
@unlair

unlair commented Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

@avallete @jgoux I'd like to know how I can get these 3 PRs looked at, especially this one here. They solve some long-standing issues and are required for me to be able to use supabase-cli on Debian (I've been using my own fork in the meantime).

@avallete pinging again, would really like someone to take a look at this or tell me why it's being passed over.

…upabase#3127, supabase#3512, supabase#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)).
@unlair
unlair force-pushed the fix/3593-docker-socket-binding branch from b829e30 to 7071ee1 Compare March 30, 2026 14:52

@avallete avallete left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank's for your contribution ! Indeed we missed that case for docker desktop.

@avallete
avallete merged commit 246be84 into supabase:develop Apr 2, 2026
20 of 21 checks passed
@unlair
unlair deleted the fix/3593-docker-socket-binding branch April 5, 2026 19:36
rlirli added a commit to rlirli/supabase-cli-fork that referenced this pull request Jul 7, 2026
…acOS (fixes supabase#5073)

## What kind of change does this PR introduce?

Bug fix (docker socket bind mount for colima, macOS-only).

## What is the current behavior?

When `config.toml` defines `[analytics] enabled = true`, `supabase start` 
starts the vector container with a bind-mount derived from 
`utils.Docker.DaemonHost()`
(`apps/cli-go/internal/start/start.go`, `case "unix"`).

Docker Desktop socket paths (`~/.docker/run/docker.sock`,
`~/.docker/desktop/docker.sock`) already take a special branch: instead
of mounting the macOS-side socket directly, the CLI bind-mounts
`/var/run/docker.sock` (`client.DefaultDockerHost`) and lets Docker
handle it under the hood (same pattern as supabase#4791 / `7071ee1`).

Colima does not match that branch. With `DOCKER_HOST` pointing at
`~/.colima/default/docker.sock` (or `~/.colima/docker.sock`), the CLI
falls through to the `else` path and bind-mounts the Colima client
socket path verbatim into vector.

On macOS + Colima this breaks `supabase start` with analytics enabled:

- **default `virtiofs` mount type:** container creation fails —
  `mkdir ~/.colima/default/docker.sock: operation not supported`
- **`sshfs` mount type:** vector starts but cannot reach dockerd —
  `Listing currently running containers failed: Connection refused`

Reported in supabase#5073. Proposed fix in stale-closed supabase#5074 by @hk220; not
merged.

## What is the new behavior?

Extend the existing Docker Desktop socket workaround to Colima:

```go
strings.HasSuffix(parsed.Host, "/.colima/default/docker.sock") ||
strings.HasSuffix(parsed.Host, "/.colima/docker.sock")
```

When matched, vector bind-mounts `/var/run/docker.sock` inside the VM
(same `dindHost.Host` self-bind as Docker Desktop), not the macOS-side
Colima forwarding socket.

Validated locally on macOS 26.5.1, Colima 0.10.3, `[analytics] enabled
= true`, fresh `colima stop && colima delete` between runs — works with
both default **`virtiofs`** and **`--mount-type sshfs`**. Vector stays
healthy; Studio Logs Explorer ingests container logs.

Fixes supabase#5073
Based on supabase#5074 by @hk220

---------

Co-authored-by: kazuki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add docker socket mount path to config.toml

3 participants