1

I'm getting what appears to be a very common error running docker. Doing a 'docker ps' as a normal user, I'll get "Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock"

A bit of googling provides obvious answers: make the calling user a member of the 'docker' group. I'm guessing in these cases the assumption is that the linux involved has setup the permissions on the .sock to be root:docker (where the 'docker' group was created as part of installing the docker software).

However on 19.04 the user/group is root/root, and there's no docker group.

I tried using setfacl to add that user, which worked great! Until I rebooted. Then, sadness. Looks like the ACLs were reset.

I'm guessing the ACL is removed because it's a socket and recreated when docker restarts.

How do I persist setfacl for this scenario? Or is there a more '19.04' way of doing this?

2

And here's the answer:

  1. A bit of digging inside the snap itself, showed that it was looking for a docker group. That group doesn't exist tho. Humpf.

Sitting within: dockers own docs. Just make the group, and assign the user to the group. Done.

2
  • I have found that the surest way to get the /var/run/docker.sock re-created with the group set to 'docker' is to restart (at least with Ubuntu 20). I've tried restarting both snapd and snap.docker.dockerd.service, and only a reboot actually changed it. May 17 '20 at 5:50
  • 1
    Just tried this on a v20 VM and for me, and it works as long as the docker group is created and user also assigned to that group. I wonder why this isn't done by the snap install? oh well.
    – scornflake
    May 19 '20 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.