denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock.......(代码片
Posted 新网工李白
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock.......(代码片相关的知识,希望对你有一定的参考价值。
1️⃣问题描述
Centos中打开docker报错
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.24/images/json: dial unix /var/run/docker.sock: connect: permission denied
2️⃣解决方法
解决方法1
sudo
切换至root权限,运行docker命令
应该都是权限的问题,忽略了root用户的切换导致docker起不来
解决方法2
docker守护进程启动的时候,会默认赋予名字为docker的用户组读写Unix socket的权限,因此只要创建docker用户组,并将当前用户加入到docker用户组中,那么当前用户就有权限访问Unix socket了,进而也就可以执行docker相关命令
sudo groupadd docker #添加docker用户组
sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中
newgrp docker #更新用户组
docker ps #测试docker命令是否可以使用sudo正常使用
以上是关于denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock.......(代码片的主要内容,如果未能解决你的问题,请参考以下文章
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 。。。
docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/
docker 下jenkens 打包出现Got permission denied while trying to connect to the Docker daemon socket at uni
docker 下jenkens 打包出现Got permission denied while trying to connect to the Docker daemon socket at uni
docker使用遇到问题Got permission denied while trying to connect to the Docker daemon socket