|
Started by user Michael de Silva |
|
09:41:21 Connecting to https://api.github.com using bsodmike/****** |
|
Obtained Jenkinsfile from cbc695e524bef85e0bff0e0bc52b60a532784cec |
|
[Pipeline] properties |
|
[Pipeline] node |
|
Running on Docker Builder (i-0c250582627987aa0) in /var/jenkins/workspace/x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA |
|
[Pipeline] { |
|
[Pipeline] stage |
|
[Pipeline] { (Debug Slave User GUID) |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ echo Which user running this node: |
|
Which user running this node: |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ whoami |
|
ubuntu |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ echo Get UID: |
|
Get UID: |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ id -u |
|
1000 |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ echo GID for docker group: |
|
GID for docker group: |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ getent group docker |
|
docker:x:999:ubuntu |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ echo Current groups: |
|
Current groups: |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ groups |
|
ubuntu adm dialout cdrom floppy sudo audio dip video plugdev netdev lxd |
|
[Pipeline] } |
|
[Pipeline] // stage |
|
[Pipeline] stage |
|
[Pipeline] { (Prep Build Tools img) |
|
[Pipeline] checkout |
|
Cloning the remote Git repository |
|
Cloning repository git@github.com:bsodmike/jenkins-simple-app.git |
|
> git init /var/jenkins/workspace/x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA # timeout=10 |
|
Fetching upstream changes from git@github.com:bsodmike/jenkins-simple-app.git |
|
> git --version # timeout=10 |
|
using GIT_SSH to set credentials simple-app Deploy Key |
|
> git fetch --tags --progress git@github.com:bsodmike/jenkins-simple-app.git +refs/heads/*:refs/remotes/origin/* |
|
> git config remote.origin.url git@github.com:bsodmike/jenkins-simple-app.git # timeout=10 |
|
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 |
|
> git config remote.origin.url git@github.com:bsodmike/jenkins-simple-app.git # timeout=10 |
|
Fetching upstream changes from git@github.com:bsodmike/jenkins-simple-app.git |
|
using GIT_SSH to set credentials simple-app Deploy Key |
|
> git fetch --tags --progress git@github.com:bsodmike/jenkins-simple-app.git +refs/heads/*:refs/remotes/origin/* |
|
> git config remote.origin1.url git@github.com:bsodmike/jenkins-simple-app.git # timeout=10 |
|
Fetching upstream changes from git@github.com:bsodmike/jenkins-simple-app.git |
|
using GIT_SSH to set credentials simple-app Deploy Key |
|
> git fetch --tags --progress git@github.com:bsodmike/jenkins-simple-app.git +refs/pull/*/head:refs/remotes/origin/pr/* |
|
Checking out Revision cbc695e524bef85e0bff0e0bc52b60a532784cec (fix/jenkins_slave_docker_user) |
|
> git config core.sparsecheckout # timeout=10 |
|
> git checkout -f cbc695e524bef85e0bff0e0bc52b60a532784cec |
|
> git rev-list 0aa7f709a93fbc4bf15898e8ffdc32f51afc113b # timeout=10 |
|
[Pipeline] sh |
|
[x_jenkins_slave_docker_user-RI5P2HVITDHDB26VODIKEPPWIXLML6YS6SLECBPGSU6GCUSHX5LA] Running shell script |
|
+ docker build -t inertialbox/build-tools:snapshot . |
|
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/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=inertialbox%2Fbuild-tools%3Asnapshot&ulimits=null: dial unix /var/run/docker.sock: connect: permission denied |
|
[Pipeline] } |
|
[Pipeline] // stage |
|
[Pipeline] } |
|
[Pipeline] // node |
|
[Pipeline] End of Pipeline |
This comment has been minimized.
bsodmike commentedMar 18, 2017
•
edited
The plot thickens!
Once the ec2 slave starts to process the
Jenkinsfilewithin the repo pulled onto the Jenkins slave notice how it does not list thedockergroup for theubuntuuser.I tried running either
sudo su - $USERorsudo newgrp dockerat the end of the slave init script based on this advice — however, this would just cause the slave to hang indefinitely. Basically, we need to re-initialise the group assignment within the existing session/shell.At the moment, I can only get the docker run to work from within the slave agent (whilst parsing the
Jenkinsfilethat is) if I disconnect and re-connect to the slave EC2 agent, simply because Jenkins does this as a new SSH connection, and logs into a new session.