欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ERROR: Couldn‘t connect to Docker daemon at http+docker://localunixsocket - is it running?

程序员文章站 2022-03-12 12:27:01
...

ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
some error with build docker env

ERROR: Couldn‘t connect to Docker daemon at http+docker://localunixsocket - is it running?

docker守护进程启动的时候,会默认赋予名为docker的用户组读写Unix socket的权限,因此只要创建docker用户组,并将当前用户加入到docker用户组中,那么当前用户就有权限访问Unix socket了,进而也就可以执行docker相关命令

1、sudo groupadd docker     #添加docker用户组
2、sudo gpasswd -a $USER docker     #将登陆用户加入到docker用户组中
3、newgrp docker     #更新用户组
4、service docker restart #记得重启

 之后正常执行

ERROR: Couldn‘t connect to Docker daemon at http+docker://localunixsocket - is it running?

相关标签: docker