首页 > 代码库 > Cannot connect to the Docker daemon. Is the docker daemon running on this host

Cannot connect to the Docker daemon. Is the docker daemon running on this host

查看docker version的时候出现Cannot connect to the Docker daemon. Is the docker daemon running on this host

原因:当前登陆的用户权限不够

两个解决方法:

1 使用sudo

sudo docker version

 

2 添加当前用户到docker group

sudo usermod -aG docker $USER

  

学习的时候最好是使用第二种,稍微方便一点,不用多敲sudo

Cannot connect to the Docker daemon. Is the docker daemon running on this host