Enable the non-root users to run ‘docker’ commands

In this blog, I will be posting the steps to provide access to non-root users.This has done on Rhel7.

-Create appropriate group
-Modify the file
-Execute the command

[user@mytest:~] sudo groupadd docker

[user@mytest:~] vim /etc/group
(Output)…
Find the line that looks like: docker:x:1001:user
Add the ‘user’ user to the end of that line (after the )
(Output)…

[user@mytest:~] sudo service docker restart (OR sudo systemctl restart docker)

[user@mytest:~] docker images
(Output)
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
(Output)

[user@mytest:~] docker pull ubuntu:latest
(Output) NOTE: Your output may differ if image has been updated
latest: Pulling from docker.io/ubuntu
6071b4935def: Pull complete
Digest: sha256:1572e29178048ad9ab72f78edd4decc91a3d8a8dea0ca39817efc7cf2d86c6d7
Status: Downloaded newer image for docker.io/ubuntu:latest
(Output)…

[user@mytest:~] docker images
(Output) NOTE: Again, your output may differ slightly
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
docker.io/ubuntu latest 8251da35e7e7 11 days ago 188.3 MB
(Output)…