Linux 查看docker version 显示cannot connect to the docker daemon at Unix :///var /run docker.sock. Is
时间: 2023-10-13 14:24:52 浏览: 50
sue:
This error message usually indicates that you are trying to run the `docker` command without sufficient permissions.
To fix this issue, try running the `docker` command with `sudo` or as the root user. For example:
```
sudo docker version
```
Alternatively, you can add your user account to the `docker` group to grant it permission to access the Docker daemon. To do this, run the following commands:
```
sudo usermod -aG docker <your-user>
sudo systemctl restart docker
```
Replace `<your-user>` with your actual username.
After adding your user to the `docker` group, you may need to log out and log back in for the changes to take effect.
Once you have the proper permissions, you should be able to run the `docker version` command without seeing the "cannot connect to the docker daemon" error.