我已经在 Windows 10 上使用 dockerd 选项安装了 Docker Rancher,并为我当前的 WSL 发行版 (Ubuntu) 安装了 WSL。
当我尝试在 WSL2 中使用 docker 时,出现以下错误:
fpapi@xxx:~$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied
该命令在 cmd shell 中运行良好。
我缺少哪种许可?
问题是 Docker Rancher 安装程序不会创建docker
团体。
使用以下命令:
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
# And something needs to be done so $USER always runs in group `docker` on the `Ubuntu` WSL
sudo chown root:docker /var/run/docker.sock
sudo chmod g+w /var/run/docker.sock
谢谢https://github.com/rancher-sandbox/rancher-desktop/issues/1156#issuecomment-1017042882 https://github.com/rancher-sandbox/rancher-desktop/issues/1156#issuecomment-1017042882
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)