首页 > 其他分享 >Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.

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

时间:2022-08-23 11:48:00浏览次数:94  
标签:daemon run socket sock connect denied var docker

[问题解决]Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

 

写了一个脚本读取docker日志,发生报错:Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

有不少方法,
1、用sudo执行脚本
2、将用户添加进docker用户

sudo usermod -aG docker ${USER}

但是这几种方法对我来说不怎么适用:
经过搜索,发现
https://stackoverflow.com/questions/47854463/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-uni
这个回答里面的第二个答案,对我来说有用。

sudo chmod 777 /var/run/docker.sock
作者: everfight 出处: http://www.cnblogs.com/everfight/ 欢迎转载

标签:daemon,run,socket,sock,connect,denied,var,docker
From: https://www.cnblogs.com/cheyunhua/p/16615587.html

相关文章