My scrapbook about almost anything I stumble upon in my tech world. If you find anything useful don't forget to give thumbs-up :)


Thursday, March 26, 2020

Resolving - Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

When running any docker command, via some other user, not root,  and getting error as - Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock  is fixable by fixing the permission for /var/run/docker.sock file.

Docker tool is install with 'root' user hence all the files and folder is owned by 'root' user only,  Let's check what permission is there for /var/run/docker.sock 

$ ls -l /var/run/docker.sock
srw-rw---- 1 root root 0 Jan 21 13:42 /var/run/docker.sock

As we can see, file's user and group is 'root' hence we are getting permission denied error. To fix this problem, change the permission of /var/run/docker.sock as below -

$ chmod 666 /var/run/docker.sock
srw-rw-rw- 1 root root 0 Jan 21 13:42 /var/run/docker.sock

We have given read/write permission to all other users by running above command, now, if we run any docker command, we will not see the permission denied error.

$ sudo docker images
REPOSITORY                                                                   TAG                 IMAGE ID            CREATED             SIZE
testimage                                                                    latest              fe74c7378812        6 days ago          288MB                                          7.5.1               8b94897b4254        3 months ago        804MB                                              7.5.1               2d043e33afa4        3 months ago        949MB                                7.5.1               2bd69c322e98        3 months ago        779MB                                           7.5.1               dbefecbff197        3 months ago        460MB                                             7.5.1               00c5b17745d1        3 months ago        359MB                                           7.5.1               9f7e0f7cbaa3        3 months ago        338MB                                          7.5.1               49132d8b2ac8        3 months ago        329MB

Voilla!!, You are set to go...see you in next post..till then...Happy Learning !!

Like the below page to get the update  
Facebook Page      Facebook Group      Twitter Feed      Telegram Group     

No comments:

Post a Comment


The postings on this site are my own and don't necessarily represent IBM's or other companies positions, strategies or opinions. All content provided on this blog is for informational purposes and knowledge sharing only.
The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of his information.