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

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

程序员文章站 2024-03-12 11:03:56
...

问题:

[[email protected] docker]# docker-compose stop
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.

解决如下:

  • 如果还没有 docker group 就添加一个

    sudo groupadd docker
  • 将用户加入该 group 内

    sudo gpasswd -a ${USER} docker
  • 重启 docker 服务

    sudo service docker restart

实例: 

[[email protected] docker]# sudo groupadd docker
groupadd: group 'docker' already exists
[[email protected] docker]# sudo gpasswd -a ${USER} docker
Adding user root to group docker
[[email protected] docker]# sudo service docker restart
Redirecting to /bin/systemctl restart docker.service
[[email protected] docker]# 

 

相关标签: Docker