You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The problem is that on rootless docker in Linux (In my case, I'm on nixos) the docker socket isn't in the default path of /var/run/docker.sock, but instead at /run/user/1000/docker.sock.
Describe the solution you'd like
Add an option to the config.toml file to be able to change the location of the mounted docker socket
Additional context
This concerns users on Linux running the supabase cli - since the vector service mounts the docker socket, it crashes when it's not able to.
I can probably name 4-5 issues + a bunch of discord issues regarding the issue of the vector service crashing because of the permissions os 13 error regarding this issue. A fix like the one above could potentially solve all of these.
Does it work today if you set the DOCKER_HOST env var when starting supabase?
DOCKER_HOST=unix:///path/to/socket supabase start
I suspect a non-root socket is not trivial because we use dind for some containers, including analytics. But happy to review the change if you open a PR.
We tested a bunch of things yesterday, and even though we didn't have much time to look into the code deeply, we believe there is a mistake in how it is being parsed. I'm not a go expert myself, but currently, the behaviour is that even though my shell's DOCKER_HOST env var isunix:///run/user/1000/docker.sock, the path that ends up being used is /run/var/docker.sock instead.
This is also the case if I run docker context inspect, it shows me the unix:///run/user/1000/docker.sock path.
We made a quick monkey patch to add the option for a dokcer_socket in the config.toml and use that for the socket path of the host instead.
I'm 99% sure the wanted behaviour is to just strip out the unix:// from the DOCKER_HOST environment variable of the shell and use that for the host socket, and always use /var/run/docker.sock for the container path.
FWIW things seem to be working for me w/ rootless Podman exposing a Docker-compatible socket if I disable analytics, so I think the issues are specific to that.
And why do you think it works if you disable analytics? @eaceaser
Here is a log of what gets printed in my console using the supabase cli version 2.12.1
Adding more on your comment - yes, you are right about the cli successfully starting up the services if you disable the analytics service. But this should NOT be the intended behaviour and we should aim to fix this instead of using workarounds.
Also, even if you disable analytics, the supabase cli is all happy and gives off the illusion that everything has started up (of course without the analytics), however, if you do dokcer ps --all, you will see that the vector service has exited with an error.
As for the pr, I'll try to work on it tomorrow and make a submission for review. Hopefully we can get this sorted out so it becomes useable in its intended behaviour.
@Fractal-Tess vector doesn't start for me when I disabled analytics? are you sure that's not an old container that hasn't been cleaned up? Besides Vector, all containers / local behavior seem to be fine when using an alternative docker socket path as far as I can tell.
IDK why you think I'm implying that this shouldn't be fixed, I was just offering a workaround when I ran into this today considering that others may find this issue.
@Fractal-Tess vector doesn't start for me when I disabled analytics? are you sure that's not an old container that hasn't been cleaned up? Besides Vector, all containers / local behavior seem to be fine when using an alternative docker socket path as far as I can tell.
IDK why you think I'm implying that this shouldn't be fixed, I was just offering a workaround when I ran into this today considering that others may find this issue.
Can you confirm the vector service starts up for you when you disable analytics and run supabase start ?
I swear to god that there was a vector service in an error exit state when I tested earlier - must have not cleaned up properly before testing - good catch!
Still, I believe this to be the cause of the docker socket, since after fixing this in the code and mounting the correct path, even with analytics and vector, it runs perfectly as intended.
I've submitted a PR with the fixes that made my system work without a problem. Hopefully, this works on all unix-like machines, but I'm not certain.
I haven't introduced an option for adding the docker_host variable to the config file, but this could also be added if you think it will be helpful to have - I personally feel like it would be awesome for there to be a knob we can set explicitly and not really on some static implementation in case issues arise later on.
@Fractal-Tess thanks for the fix; I can confirm having DOCKER_HOST=unix:// works for me as well. In my case, I also needed #3150.
Regarding the docker_host config option, I would not think that is required as this is local to user's environment. Would be odd to have that in a shared config (assuming config.toml is intended to be shared).
For those that stumble upon this thread looking for a solution to:
failed to start docker container: Error response from daemon: mounts denied: The path /socket_mnt/home/user/.docker/desktop/docker.sock is not shared from the host and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing. See https://docs.docker.com/ for more info.
In docker desktop at the settings -> Builders, change the desktop-linux builder to default (Might need to install the native Docker engine).
Activity
Fractal-Tess commentedon Feb 11, 2025
A friend of mine is open to adding this change in (PR) as we already have done this in a fork if people are interested.
sweatybridge commentedon Feb 12, 2025
Does it work today if you set the
DOCKER_HOSTenv var when starting supabase?I suspect a non-root socket is not trivial because we use dind for some containers, including analytics. But happy to review the change if you open a PR.
Fractal-Tess commentedon Feb 12, 2025
We tested a bunch of things yesterday, and even though we didn't have much time to look into the code deeply, we believe there is a mistake in how it is being parsed. I'm not a go expert myself, but currently, the behaviour is that even though my shell's
DOCKER_HOSTenv var isunix:///run/user/1000/docker.sock, the path that ends up being used is/run/var/docker.sockinstead.This is also the case if I run
docker context inspect, it shows me theunix:///run/user/1000/docker.sockpath.We made a quick monkey patch to add the option for a
dokcer_socketin the config.toml and use that for the socket path of the host instead.I'm 99% sure the wanted behaviour is to just strip out the
unix://from theDOCKER_HOSTenvironment variable of the shell and use that for the host socket, and always use/var/run/docker.sockfor the container path.eaceaser commentedon Feb 12, 2025
FWIW things seem to be working for me w/ rootless Podman exposing a Docker-compatible socket if I disable analytics, so I think the issues are specific to that.
Fractal-Tess commentedon Feb 12, 2025
And why do you think it works if you disable analytics? @eaceaser
Here is a log of what gets printed in my console using the supabase cli version 2.12.1
Should be pretty self-explanatory.
Adding more on your comment - yes, you are right about the cli successfully starting up the services if you disable the analytics service. But this should NOT be the intended behaviour and we should aim to fix this instead of using workarounds.
Also, even if you disable analytics, the supabase cli is all happy and gives off the illusion that everything has started up (of course without the analytics), however, if you do
dokcer ps --all, you will see that the vector service has exited with an error.As for the pr, I'll try to work on it tomorrow and make a submission for review. Hopefully we can get this sorted out so it becomes useable in its intended behaviour.
Thank you
edit - grammar
eaceaser commentedon Feb 12, 2025
@Fractal-Tess vector doesn't start for me when I disabled analytics? are you sure that's not an old container that hasn't been cleaned up? Besides Vector, all containers / local behavior seem to be fine when using an alternative docker socket path as far as I can tell.
IDK why you think I'm implying that this shouldn't be fixed, I was just offering a workaround when I ran into this today considering that others may find this issue.
Fractal-Tess commentedon Feb 12, 2025
Can you confirm the vector service starts up for you when you disable analytics and run
supabase start?eaceaser commentedon Feb 12, 2025
yes:
edit: to be clear, it does NOT start up when analytics is disabled, hence the workaround
Fractal-Tess commentedon Feb 12, 2025
Hum... yeah you are right. This is on me.
I swear to god that there was a vector service in an error exit state when I tested earlier - must have not cleaned up properly before testing - good catch!
Still, I believe this to be the cause of the docker socket, since after fixing this in the code and mounting the correct path, even with analytics and vector, it runs perfectly as intended.
Fractal-Tess commentedon Feb 13, 2025
I've submitted a PR with the fixes that made my system work without a problem. Hopefully, this works on all unix-like machines, but I'm not certain.
I haven't introduced an option for adding the
docker_hostvariable to the config file, but this could also be added if you think it will be helpful to have - I personally feel like it would be awesome for there to be a knob we can set explicitly and not really on some static implementation in case issues arise later on.Anyway, let me know what you think @sweatybridge.
Thank you for your time.
abn commentedon Feb 15, 2025
@Fractal-Tess thanks for the fix; I can confirm having
DOCKER_HOST=unix://works for me as well. In my case, I also needed #3150.Regarding the
docker_hostconfig option, I would not think that is required as this is local to user's environment. Would be odd to have that in a shared config (assumingconfig.tomlis intended to be shared).Sibor2000 commentedon Oct 26, 2025
For those that stumble upon this thread looking for a solution to:
failed to start docker container: Error response from daemon: mounts denied: The path /socket_mnt/home/user/.docker/desktop/docker.sock is not shared from the host and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing. See https://docs.docker.com/ for more info.In docker desktop at the settings -> Builders, change the desktop-linux builder to default (Might need to install the native Docker engine).
Aarbel commentedon Jan 14, 2026
Same error here on mac, any fixed planned to be compatible with docker ?
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding when starting vector img (fixes s…
fix: use correct docker.sock binding with vector (fixes #3127, #3512, #…