每次服务器重启,在docker中运行的jenkins中使用docker时遇到以下错误
time="2023-04-15T13:55:46Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: permission denied"
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "
这是因为服务器重启后 docker.sock 文件重新生成,其权限也回到初始化状态,在docker容器中并没有该文件的访问权限。只需要在宿主服务器中执行以下命令即可
chmod 777 /var/run/docker.sock
标签:run,错误,sock,connect,var,jenkins,docker
From: https://www.cnblogs.com/xyarch/p/17323251.html