解决Docker运行命令时提示"Got permission denied while trying to connect to the Docker daemon socket"类情况
Docker安装命令:

解决Docker运行命令时提示"Got permission denied while trying to connect to the Docker daemon socket"类情况,提示如下:

原因:
摘自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 docker and add users to it.
When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.
大概的意思就是:docker进程使用Unix Socket而不是TCP端口。而默认情况下,Unix socket属于root用户,需要root权限才能访问。
解决方法1
使用sudo获取管理员权限,运行docker命令。
解决方法2
docker守护进程启动的时候,会默认赋予名字为docker的用户组读写Unix socket的权限,因此只要创建docker用户组,
并将当前用户加入到docker用户组中,那么当前用户就有权限访问Unix socket了,进而也就可以执行docker相关命令。
sudo groupadd docker #添加docker用户组
sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中
newgrp docker #更新用户组
docker ps #测试docker命令是否可以使用sudo正常使用
检查是否成功:
执行"docker version"命令,发现不再出现"Got permission denied"权限报错,如上图示。
解决Docker运行命令时提示"Got permission denied while trying to connect to the Docker daemon socket"类情况的更多相关文章
- Docker启动时提示Get Permission Denied while trying to connect解决方法
环境描述 vmware15虚拟机安装centos7.4 64位系统,docker版本19.03.2 问题描述 安装完docker后,执行docker相关命令 docker run ubuntu:15. ...
- 启动docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
启动docker提示: docker: Got permission denied while trying to connect to the Docker daemon socket at uni ...
- Got permission denied while trying to connect to the Docker daemon socket at
添加新用户后执行docker命令由于没权限出现以下报错: ”Got permission denied while trying to connect to the Docker daemon soc ...
- 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.38/images/json: dial unix /var/run/docker.sock: conne
使用docker报如下错误信息: Got permission denied while trying to connect to the Docker daemon socket at unix:/ ...
- Got permission denied while trying to connect to the Docker daemon socket at unix
拉取Dockerimages时错误信息如下: [master@localhost ~]$ docker pull redis Using default tag: latest Got permiss ...
- docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post
利用docker构建时,报错 + docker pull maven:3-alpine Got permission denied while trying to connect to the Doc ...
- Docker permission denied while trying to connect to the Docker daemon socket
Problem jenkins执行docker打包的时候报错,说没有权限 docker build -t docker.ryan-miao.com/com.demo:f1aa23e --build-a ...
- [问题解决]Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
写了一个脚本读取docker日志,发生报错:Got permission denied while trying to connect to the Docker daemon socket at u ...
- window10上登录Oracle时提示ORA-12546:Permission denied
在64位的Windows 10上安装了Oracle 10.2.0.4的64位版,遇到不少问题. 虽然可能现在安装这个版本越来越少,还是分享出来,希望能帮助到一些人. 1.安装的过程遇到的问题 在普通用 ...
随机推荐
- this和super的区别和应用
A:this和super都代表什么 * this:代表当前对象的引用,谁来调用我,我就代表谁 * super:代表当前对象父类的引用B:this和super的使用区别 * a:调用成员变量 * th ...
- redis笔记补充
redis补充 这篇文章是redis入门笔记的补充. 1.info命令 用来显示服务的信息. info命令可以跟下面的选项: server: 关于 Redis 服务器的一些信息 clients: 客户 ...
- kubectl scale sts
使用scale 不单单是扩容还可以:1.动态扩展服务,增加承载能力2.如果出现pod异常,可以利用这种方式,增加pod,再删除原来的pod 比如:pod所在宿主机网络或者宿主机死掉注: 但是一旦有某个 ...
- Gradle 安装记录
Gradle 安装记录 官网 https://gradle.org/ 参考文档 https://gradle.org/install/ 下载地址 <二进制文件> <源码+文档> ...
- GopherCon SG 2019 "Understanding Allocations" 学习笔记
本篇是根据 GopherCon SG 2019 "Understanding Allocations" 演讲的学习笔记. Understanding Allocations: th ...
- Centos7 搭建 Socks 服务
Centos7 搭建 Socks 服务 一丶拿到一个动态拨号的服务器还不能使用网络得先打开: pppoe-start 二丶安装命令汇总: 通过yum安装ss5 依赖包: yum install gcc ...
- 1903021116—吉琛—Java第六周作业—类的定义
项目 内容 课程班级博客链接 19信计班 这个作业要求链接 第六周作业链接 java面向对象的概念和定义 博客名称 学号-姓名-Java第六周作业-题目自拟 要求 每道题要有题目,代码(使用插入代码, ...
- 缓存中间件-Redis(二)
在上一篇中我们简单总结和介绍了Redis的几个方面 1.使用Redis背景 2.Redis通信多路复用的基本原理 3.Redis基本数据结构 4.Redis持久化方式 这一篇我们使用简单的业务场景来介 ...
- python基础练习题(暂停一秒输出,并格式化当前时间)
day5 --------------------------------------------------------------- 实例010:给人看的时间 题目 暂停一秒输出,并格式化当前时间 ...
- centos下安装ansible自动化工具(超详细,包含基本使用)
ansible官网:https://www.ansible.com 众所周知,ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfengine.chef ...
