Skip to content

Instantly share code, notes, and snippets.

@AppleBoiy
Created November 21, 2023 06:45
Show Gist options
  • Save AppleBoiy/5160e32435fc5dd85ff3e0ace5bbd4ec to your computer and use it in GitHub Desktop.
Save AppleBoiy/5160e32435fc5dd85ff3e0ace5bbd4ec to your computer and use it in GitHub Desktop.
ISSUE: Docker Rancher - Permission Denied when using docker from WSL

stackoverflow issue: https://stackoverflow.com/q/72528606/22440363

$ 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

FIX

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

relate issue: rancher-sandbox/rancher-desktop#1156 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment