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?

运行docker-compose up -d时报错:

$ docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

解决办法:
1、启动docker:

启动        systemctl start docker
守护进程重启   sudo systemctl daemon-reload
重启docker服务   systemctl restart  docker
重启docker服务  sudo service docker restart
关闭docker   service docker stop   
关闭docker  systemctl stop docker

2、将当前用户加入docker用户组:

$ sudo gpasswd -a ${USER} docker
重新登陆当前用户
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页