The Problem
A regular user is not able list images using docker images command. Following error can be observed.
user01> docker images 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.27/images/json: dial unix /var/run/docker.sock: connect: permission denied
The Solution
User is not part of docker group and doesn’t have permissions to execute docker related commands.
Add regular user to docker group so that they would able to use docker commands.
[root@host-docker ~]# id user01 uid=1000(user01) gid=1000(user01) groups=1000(user01),10(wheel),983(docker) [root@host-docker ~]#
[root@host-docker ~]# su - user01 Last login: Thu May 24 23:17:03 IST 2018 from example.com on pts/1 [user01@host-docker ~]$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE user01 latest ab15b83d00ea 32 hours ago 1.29GB test_web latest 07d0c8441153 6 days ago 234MB