1

I have a fresh installation of Linux Mint 22 (Vanessa) and installed docker with

$ sudo apt install docker-compose $ docker -v Docker version 20.10.12, build 20.10.12-0ubuntu4 $ sudo systemctl start docker $ sudo systemctl enable docker $ groups shows a list without "docker" group $ sudo usermod -aG docker $USER [sudo] password for xyz $ groups shows a list with "docker" group $ sg docker -c "bash" $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ getent group docker docker:x:137:xyz

But a few hours later, I have to enter again:

$ sudo usermod -aG docker $USER $ sg docker -c "bash"

to avoid:

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?all=1": dial unix /var/run/docker.sock: connect: permission denied

I need to enter the command again and again. I also tried instead:

$ sudo gpasswd -a $USER docker
Adding user xyz to group docker
$ newgrp docker

which leads to the same, everything works, but the "docker" group was still dropped after some time for some reason.

What shall I do to keep the membership of my user in that "docker" group and the group itself alive?

1 Answers1

0

Sharing this since it cost me hours. At the moment when you see the docker group, restart the system. Which you do not like to do when many windows are open and docker containers run. But that made it in the end.

After restart, the "docker" group was still there, the rights were there, and they have not been forgotten since.