-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL /var/run/docker.sock permissions #1156
Comments
@rgl this is something we have discussed and trying to find the best experience is difficult. For example, if I use apt to install docker inside of WSL in Ubuntu and use it there I would get the same permission denied message. The expectation in that situation is to add the default user to the group or to be root/sudo. Do follow the native Ubuntu pattern (which applies to other distros as well) or break from the native pattern? This is situation we face. |
Also, please note that if the |
After creating the $ sudo groupadd --system docker
$ sudo usermod -aG docker rgl
$ exit
$ id
uid=1000(rgl) gid=1000(rgl) groups=1000(rgl),0(root),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),116(admin),117(netdev),999(docker) The socket now has the correct permissions: $ ll /var/run/docker.sock
srwxrwxr-x 1 root docker 0 Dec 24 05:58 /var/run/docker.sock= Thanks for pointing that out! Though it still fails with the error that I've pointed before: $ docker ps
request returned Bad Gateway for API route and version http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json, check if the server supports the requested API version |
This looks like it'll work:
|
It's a doc issue -- see rancher-sandbox/docs.rancherdesktop.io#5 |
And merged into the docs repo at rancher-sandbox/docs.rancherdesktop.io#5 (comment) |
Not sure what is going on; but like I've mentioned before, even after changing the socket file permissions, This is how it fails: $ docker ps
request returned Bad Gateway for API route and version http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json, check if the server supports the requested API version |
Here's the sort of thing I would expect to see running the following commands (in my case, in an Ubuntu subsystem that has been checked on the
|
The docs currently have an incorrect command. They use |
I'm also experiencing the |
Fixed by putting a solution in the FAQ |
For me, vanilla WSL default Ubuntu (wsl -v 2)
|
In Rancher Desktop 1.8.0+ the socket should be world readable/writable, so you don't need to create the docker group anymore: $ ls -l /var/run/docker.sock
srwxrwxrwx 1 root root 0 Mar 23 21:19 /var/run/docker.sock |
Rancher Desktop Version
0.7.1
Rancher Desktop K8s Version
1.22.5
What operating system are you using?
Windows
Operating System / Build Version
Windows 10
What CPU architecture are you using?
x64
Windows User Only
No response
Actual Behavior
Cannot use docker as a regular ubuntu user.
Steps to Reproduce
docker ps
Result
Expected Behavior
To be able to use docker as a regular user.
Maybe put the docker socket in a
docker
group and set its permissions torwxrwxr-x root docker
.Additional Information
Running
docker ps
from Windows (e.g. from a powershell session) works fine.But running
docker ps
from within WSL Ubuntu does not work.It also fails to work when I add my user to the
root
group:The text was updated successfully, but these errors were encountered: