ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
程序员文章站
2022-03-12 12:37:24
...
通过docker-compose 的build up 等命令时报如下错误
$ docker-compose up
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
docker-compose up
注意: 添加到docker用户组后要重新登录shell再up。 -
docker服务器未启动, 启动命令如下:
sudo systemctl start docker // 或者 sudo service docker start
docker-compose up
-
docker服务启动,被缓存影响,可通过重启解决
sudo systemctl restart docker // 或者 sudo service docker restart
docker-compose up
-
也许使用sudo 就好了
sudo docker-compose up
-
docker-compose版本太老了,更新版本
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose up
-
重启系统
sudo reboot docker-compose up
推荐阅读
-
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
-
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
-
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
-
ERROR: Couldn‘t connect to Docker daemon at http+docker://localhost - is it running?
-
解决ERROR: Couldn't connect to Docker daemon at http://127.0.0.1:4243 - is it running
-
解决 docker中 error:Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
-
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
-
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
-
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
-
解决ERROR: Couldn't connect to Docker daemon at http://127.0.0.1:4243 - is it running