jenkins linux用户权限,linux – 为什么Jenkins用户没有权限访问Docker unix套接字?

我已经将jenkins用户添加到docker组,认为它允许Jenkins作业运行Docker命令.如果我切换到jenkins用户,我可以验证它是否有效(手动):

ubuntu@hostname:~$ps aux | grep java

jenkins 2210 9.5 7.5 1950316 292896 ? Sl 00:01 1:00 /usr/bin/java -jar /data/jenkins/jenkins-1.586.war --httpPort=8080 -Xloggc:/var/log/jenkins/gc.log

ubuntu@hostname:~$getent group docker

docker:x:999:jenkins

ubuntu@hostname:~$ls -la /var/run/docker.*

-rw-r--r-- 1 root root 4 Oct 23 18:32 /var/run/docker.pid

srw-rw---- 1 root docker 0 Oct 23 18:32 /var/run/docker.sock

ubuntu@hostname:~$sudo su -s /bin/bash jenkins

jenkins@hostname:/home/ubuntu$docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

但是,在Jenkins构建/作业期间,它没有权限:

# Job log

Started by user Matt Wright

Building on master in workspace /data/jenkins/jobs/docker-base-images-build/workspace

[ssh-agent] Using credentials CI-jenkins

[ssh-agent] Looking for ssh-agent implementation...

[ssh-agent] Java/JNR ssh-agent

[ssh-agent] Started.

> git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

> git config remote.origin.url git@github.com:/docker-base-images.git # timeout=10

Fetching upstream changes from git@github.com:/docker-base-images.git

> git --version # timeout=10

using GIT_SSH to set credentials

> git fetch --tags --progress git@github.com:/docker-base-images.git +refs/heads/*:refs/remotes/origin/*

> git rev-parse refs/remotes/origin/master^{commit} # timeout=10

> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10

Checking out Revision 83c4463e7195b412a3a803dd7338210c1a772f55 (refs/remotes/origin/master)

> git config core.sparsecheckout # timeout=10

> git checkout -f 83c4463e7195b412a3a803dd7338210c1a772f55

> git rev-list 83c4463e7195b412a3a803dd7338210c1a772f55 # timeout=10

[workspace] $/bin/sh -xe /tmp/hudson5606381166745886966.sh

+ ./build.sh

Sending build context to Docker daemon

2014/10/24 16:14:18 Post http:///var/run/docker.sock/v1.15/build?rm=1&t=%2Fpython%3A3.4: dial unix /var/run/docker.sock: permission denied

Build step 'Execute shell' marked build as failure

[ssh-agent] Stopped.

Notifying upstream projects of job completion

Finished: FAILURE

这是Docker 1.3.0和Ubuntu 14.04.1.有什么线索吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值