解决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.安装的过程遇到的问题 在普通用 ...
随机推荐
- Centos搭建 LAMP 服务器教程
搭建 LAMP 服务 搭建 MySQL 数据库 安装 MySQL 使用 yum 安装 MySQL: yum install mysql-server -y 安装完成后,启动 MySQL 服务: ser ...
- box-shadow 阴影的高级用法,多个阴影叠加
box-shadow的这些用法你知道吗? $shadowH: ''; @for $i from 1 through 12 { $shadowH: #{$shadowH}, 0 ($i * 30px) ...
- DC-1 靶机渗透
DC-1 靶机渗透 *概况*: 下载地址 https://www.vulnhub.com/entry/dc-1,292/ *官方描述:* DC-1 is a purposely built vulne ...
- 2021年Java后端技术知识体系
-----2021/1/22
- linux中rsync备份文件
linux中rsync备份文件 备份文件的方式 备份方式: cp : 本机复制 scp: 远程复制 推(本地上传到远程服务器): scp 1.txt root@ip:[路径] [root@m01 ~] ...
- OpenHarmony 3.1 Release版本发布
OpenHarmony 3.1 Release 版本概述 当前版本在OpenHarmony 3.1 Beta的基础上,更新支持以下能力: 标准系统基础能力增强 本地基础音视频播放能力.视频硬编解码.相 ...
- 2021.11.09 P4824 [USACO15FEB]Censoring S与P3121 [USACO15FEB]Censoring G(KMP&&AC自动机)
2021.11.09 P4824 [USACO15FEB]Censoring S与P3121 [USACO15FEB]Censoring G(KMP&&AC自动机) https://w ...
- 《手写Mybatis》第5章:数据源的解析、创建和使用
作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.前言 管你吃几碗粉,有流量就行! 现在我们每天所接收的信息量越来越多,但很多的个人却没有多 ...
- 玩转LiteOS组件:玩转Librws
摘要:Librws是一个跨平台的websocket客户端,使用C语言编写. 本文分享自华为云社区<LiteOS组件尝鲜-玩转Librws>,作者: W922 . 本期小编为大家带来Lite ...
- 教你轻松解决CSRF跨站请求伪造攻击
摘要:CSRF(Cross-site request forgery)跨站请求伪造,通过伪装来自受信任用户的请求来利用受信任的网站.与XSS攻击相比,CSRF攻击往往不大流行(因此对其进行防范的资源也 ...
