当前位置: 代码迷 >> 综合 >> Docker 安装后 报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemo
  详细解决方案

Docker 安装后 报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemo

热度:131   发布时间:2023-09-06 15:41:47.0

刚在新的Centos上安装Docker-CE,后运行docker run hello-world报错Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

解决办法
$ systemctl daemon-reload
$ sudo service docker restart
$ sudo service docker status (should see active (running))
$ sudo docker run hello-world

docker 客户端通过unix:///var/run/docker.sock与docker daemon通信,unix:///var/run/docker.sock需要管理员权限才能访问,所以要么运行sudo docker run hello-world,要么将当前用户添加在docker用户组中
sudo usermod -aG docker $USER

  相关解决方案