打开终端直接输入 docker 命令时出现以下错误:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json: dial unix /var/run/docker.sock: connect: permission denied
解决办法:
将非root用户加入docker组
usermod -aG docker yourUserName
更新docker组信息
newgrp - docker
查看docker组信息
getent group docker