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.35/images/json: dial unix /var/run/docker.sock: connect: permission denied
原因:
在容器内部无法使用docker的命令, 在docker通信时,权限不足
解决方法:
1、添加用户组的方式解决问题(只适用于在容器外部部署的方式)
在容器本身就是在docker中部署的,容器所在的用户在容器内部,所以无法把容器所在的用户加入到docker.sock的用户组
2、修改相关文件或文件夹(docker.sock)权限为777,或者直接暴露docker.sock
风险较大,在任何地方都能使用docker命令了,很有可能会被恶意攻击者完全的接管。
3、使用root用户权限启动容器
在启动命令中加入-u root
相关文章
- 11-24Got permission denied while trying to connect to the Docker daemon socket at unix
- 11-24docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/
- 11-24启动docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/r
- 11-24Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.
- 11-24Got permission denied while trying to connect to the Docker daemon socket
- 11-24Got permission denied while trying to connect to the Docker daemon socket at unix
- 11-24docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run
- 11-24解决: Got permission denied while trying to connect to the Docker daemon socket
- 11-24docker权限不足Got permission denied while trying to connect to the Docker daemon socket at unix:///var/r
- 11-24docker启动:Got permission denied while trying to connect to the Docker daemon