Problem

jenkins执行docker打包的时候报错,说没有权限

docker build -t docker.ryan-miao.com/com.demo:f1aa23e --build-arg SPRING_PROFILE=prod --build-arg JAR_FILE=target/demo-1.0-SNAPSHOT.jar .

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'

Solution

可以使用sudo root权限执行,但我们还是想要用jenkins用户来做这件事。只要把jenkins添加到docker的group里就可以了。

sudo usermod -a -G docker jenkins

这时候,重新jenkins构建依旧是不行的。需要刷新session。所以,需要重启jenkins。

Docker permission denied while trying to connect to the Docker daemon socket的更多相关文章

  1. Solving Docker permission denied while trying to connect to the Docker daemon socket

    The error message tells you that your current user can’t access the docker engine, because you’re la ...

  2. 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 ...

  3. 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:/ ...

  4. 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 ...

  5. 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 ...

  6. [问题解决]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 ...

  7. 启动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 ...

  8. 解决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 ...

  9. Docker Got permission denied while trying to connect to the Docker daemon socket at unix://

    这是没有权限的原因,先将自己加入docker组,然后在重新启动就可以了, 下面参考来源:https://blog.csdn.net/weixin_40896352/article/details/80 ...

随机推荐

  1. Rsync + Sersync 实现数据增量同步

    部分引用自:https://blog.csdn.net/tmchongye/article/details/68956808 一.什么是Rsync? Rsync(Remote Synchronize) ...

  2. 修改input 的 placeholder

    input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #666!important; } inp ...

  3. BZOJ2821 作诗(Poetize) 主席树 bitset

    原文链接https://www.lydsy.com/JudgeOnline/problem.php?id=2821 题目传送门 - BZOJ2821 题意 $n$ 个数,$m$ 组询问,每次问 $[l ...

  4. Codeforces 1000G Two-Paths 树形动态规划 LCA

    原文链接https://www.cnblogs.com/zhouzhendong/p/9246484.html 题目传送门 - Codeforces 1000G Two-Paths 题意 给定一棵有 ...

  5. html-盒子模型及pading和margin相关

    margin: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  6. 生日蛋糕 POJ - 1190 (搜索+剪枝)

    7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体. 设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱.当 ...

  7. Codeforces 1096D Easy Problem 【DP】

    <题目链接> 题目大意: 给你一个字符串,每个字符有权值,问现在删除字符串中的字符使其中没有"hard"的最小代价是多少. 解题分析: 用DP来求解:        转 ...

  8. HDU 2444 二分图判断 (BFS染色)+【匈牙利】

    <题目链接> 题目大意: 有N个人,M组互相认识关系互相认识的两人分别为a,b,将所有人划分为两组,使同一组内任何两人互不认识,之后将两个组中互相认识的人安排在一个房间,如果出现单人的情况 ...

  9. 李宏毅机器学习笔记3:Classification、Logistic Regression

    李宏毅老师的机器学习课程和吴恩达老师的机器学习课程都是都是ML和DL非常好的入门资料,在YouTube.网易云课堂.B站都能观看到相应的课程视频,接下来这一系列的博客我都将记录老师上课的笔记以及自己对 ...

  10. ubantu 执行sudo apt-get update 出现校验不符问题

    一直被这个问题困扰,今天安装mongodb时,看了别人博客暂时解决了,不知道会不会出什么问题. 直接打开软件更新器: 然后点击其他软件,去掉两个独立的多选项: 再执行一遍 sudo apt-get u ...