目录
1 问题描述
在终端执行"docker version"命令,出现如下报错:
”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.26/images/json: dial unix /var/run/docker.sock: connect: permission denied“

2 原因分析
来自docker mannual:
Manage Docker as a non-root user
The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The docker daemon always runs as the root user.
If you don’t want to use sudo when you use the docker command, create a Unix group called doc

本文详细解析了在执行dockerversion命令时遇到的权限拒绝错误,深入分析其原因并提供了解决方案,包括创建docker用户组、将用户添加到该组以及验证权限更改的有效性。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



