1

I am pretty naive in this, and therefore, please forgive me for asking these questions:

  1. I am required to add a couple of non-root users (without the sudo access) to the docker group so they can set up their own environments. I, accordingly, followed the instructions on https://docs.docker.com/engine/install/linux-postinstall/ to get this done. The docker group was already there, and therefore, I was able to add the users via sudo usermod -aG docker $USER.
  2. I did $sudo newgrp docker too to activate the changes. This takes me to the root terminal and I can test the docker as docker run hello-world. But when I try to check it outside this terminal with docker run hello-world, it returns an error as: "Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:......connect: permission denied".
  3. My question is how can I ensure that the users I had added to the Docker Group would be able to access the docker as a non-root users (without the sudo access)?

1 Answer 1

1

You would be safe by Running the Docker daemon as a non-root user (Rootless mode). Simply follow instructions here.

As for your specific question "How can I ensure that the users I had added to the Docker Group would be able to access the docker as a non-root users (without the sudo access)?", simply run

 $ docker run hello-world

from the user you want to check.

0

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.