docker.el
docker.el copied to clipboard
Permission denied when performing certain operations with docker-run-as-root
When performing certain operations I get errors such as
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.40/containers/nginx/json": dial unix /var/run/docker.sock: connect: permission denied
these are usually operations that involve "stepping inside" the container - e.g. finding a file or opening a shell. I can perform operations such as restarting, stopping, and viewing the logs of containers just fine.
I am using docker-run-as-root
. In my environment I cannot add myself to the docker group due to the security implications.
I am using Doom emacs @ emacs 27.
Good catch, it's beause it uses TRAMP (https://github.com/Silex/docker.el/blob/master/docker-container.el#L138)
So basically one of the fix could be to use TRAMP multi-hop method and add another sudo:
to the TRAMP url... but honestly it looks fragile, TRAMP being already quite fragile.
I have no idea how to fix this without creating a monster mess. You should probably use docker context
which is partially supported by docker.el