reddit / emacs

Permission denied with docker in emacs

warferwille · 2022-02-10 20:20
I'm trying docker-el but i'm getting the following error: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: I get the same error in vterm running: docker run hello-world But it works fine outside emacs. Any suggestions how to resolve this? I'm using spacemacs with docker layer.
Horrih · 2022-02-10 21:22
Haven't used the emacs layer but this error is typically due to the current user not being in the docker group. This is typically fixed by using sudo usermod a+G docker $USER and then logging off + loggin in again. Did you start emacs with the same user as your trials in the terminal ? Have you logged off Everything before starting emacs again ?
7890yuiop · 2022-02-11 00:31
Agreed, it's probably this. You can also try running `sg docker "docker run hello-world"` instead of `docker run hello-world`. Logging out and back in will ensure your initial user session has the necessary groups and avoid the need to jump through hoops. It's an annoyance, but by my recollection there isn't a way to inject that information into the existing session.
warferwille · 2022-02-11 09:24
Thanks now i works. I had to restart my computer though.