After installing docker, execute the docker command, prompting no permission.
sGot permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get …/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied
Solution
1. Use the root user to operate docker, and the company generally does not give root permission. . .
2. Add the current operating user to the docker group, and the docker group will be created by default during installation
$ sudo gpasswd -a $USER docker
Adding user qard to group docker
$ newgrp docker
Execute the docker command again, and it can be used normally.
$ docker ps
..
$ docker images
..
If it still doesn't work, restart docker
$ sudo systemctl restart docker