写了一个脚本读取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

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2021-09-13
  • 2021-08-07
  • 2022-12-23
  • 2021-11-19
  • 2021-06-11
  • 2021-10-20
猜你喜欢
  • 2021-07-11
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
相关资源
相似解决方案