Skip to content

Instantly share code, notes, and snippets.

@wittawasw
Last active September 11, 2024 09:29
Show Gist options
  • Save wittawasw/0d4a395cdf336541d72178e3bbc885aa to your computer and use it in GitHub Desktop.
Save wittawasw/0d4a395cdf336541d72178e3bbc885aa to your computer and use it in GitHub Desktop.
# Fix permission denied while trying to connect to the Docker daemon socket
# at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/json":
# dial unix /var/run/docker.sock: connect: permission denied
# source: https://github.com/rancher-sandbox/rancher-desktop/issues/1156#issuecomment-1017042882
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment