"Couldn't connect to Docker daemon at http+docker://"错误解决
今天在服务器上安装docker并执行docker-compose up -d命令时,报错如下: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 ...
·
今天在服务器上安装docker并执行
docker-compose up -d
命令时,报错如下:
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.
解决方法如下:
-
执行如下命令将当前用户加入docker用户组:
sudo gpasswd -a ${USER} docker
-
将当前用户切换到root,然后再切换回来,比如当前用户为ubuntu,执行如下命令:
// 切换到root用户 sudo su // 从root用户切换回ubuntu用户 su ubuntu
-
再执行如下命令就不会报错了
docker-compose up -d
更多推荐
已为社区贡献2条内容
所有评论(0)