[JIRA] (JENKINS-46799) Blueocean Docker Pipeline Failed | Cannot start docker container

7 views
Skip to first unread message

enric.prats@gmail.com (JIRA)

unread,
Nov 10, 2018, 1:11:02 AM11/10/18
to jenkinsc...@googlegroups.com
Enric Prats updated an issue
 
Jenkins / Bug JENKINS-46799
Blueocean Docker Pipeline Failed | Cannot start docker container
Change By: Enric Prats
Priority: Major Minor
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

enric.prats@gmail.com (JIRA)

unread,
Nov 10, 2018, 1:11:02 AM11/10/18
to jenkinsc...@googlegroups.com
Enric Prats reopened an issue
 

Marcelo Tocchetto workaround is good but people should not have to change the docker image once downloaded and running. 

This should be changed on the Dockerfile which builds the image

Change By: Enric Prats
Resolution: Not A Defect
Status: Closed Reopened

enric.prats@gmail.com (JIRA)

unread,
Nov 10, 2018, 1:26:02 AM11/10/18
to jenkinsc...@googlegroups.com
Enric Prats edited a comment on Bug JENKINS-46799
 
Re: Blueocean Docker Pipeline Failed | Cannot start docker container
[~mtocchetto] workaround is good but people should not have to change the docker image once downloaded and running. 

This should be changed on the Dockerfile which builds the image
.

 

It's enough to add to the Jenkinsfile:

    # Allow Jenkins to run docker commands

    chown :jenkins /var/run/docker.sock

 

I will try to figure how to make the pull request but I have never made one :(

gmogan@cloudbees.com (JIRA)

unread,
Feb 8, 2019, 6:23:02 PM2/8/19
to jenkinsc...@googlegroups.com

I'm pretty sure you can use `--group-add` (I have it setup on my instance, I just forgot if this is why)

on my system docker group is 978 `getent group docker | awk -F: '{print $3}'`

so the following will make the jenkins user (which the container runs as) also have the GID of 978

docker run -v /var/run/docker.sock:/var/run/docker.sock --group-add 978 -p 8080:8080 --name jenkins_blueocean jenkinsci/blueocean:latest

gmogan@cloudbees.com (JIRA)

unread,
Feb 8, 2019, 6:24:01 PM2/8/19
to jenkinsc...@googlegroups.com

I just tried it on my ubuntu laptop, group-add 999 and seems to work.

 

gmogan@cloudbees.com (JIRA)

unread,
Feb 8, 2019, 6:24:03 PM2/8/19
to jenkinsc...@googlegroups.com
Gavin Mogan updated an issue
 
Change By: Gavin Mogan
Attachment: image-2019-02-08-15-23-14-655.png

gmogan@cloudbees.com (JIRA)

unread,
Feb 8, 2019, 6:25:02 PM2/8/19
to jenkinsc...@googlegroups.com
 
Re: Blueocean Docker Pipeline Failed | Cannot start docker container

I think the key is --group-add takes in a GID, not a group name

gmogan@cloudbees.com (JIRA)

unread,
Feb 8, 2019, 6:28:02 PM2/8/19
to jenkinsc...@googlegroups.com

My bad, it does take in groups, but maps it to the containers group name, not the host's group names

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --group-add 999 -p 8080:8080 --name jenkins_blueocean --entrypoint "" jenkinsci/blueocean:latest id 

uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins),999(ping) 

vs

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --group-add 999 -p 8080:8080 --name jenkins_blueocean --entrypoint "" jenkinsci/blueocean:latest id
  
uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins),999(ping)

gmogan@cloudbees.com (JIRA)

unread,
Feb 12, 2019, 10:14:03 AM2/12/19
to jenkinsc...@googlegroups.com
Gavin Mogan closed an issue as Not A Defect
 
Change By: Gavin Mogan
Status: Reopened Closed
Resolution: Not A Defect

alcmaeon@gmail.com (JIRA)

unread,
Oct 20, 2019, 12:53:03 AM10/20/19
to jenkinsc...@googlegroups.com
Enrique Diaz commented on Bug JENKINS-46799
 
Re: Blueocean Docker Pipeline Failed | Cannot start docker container

That solved one issue, but now I get 
+ docker inspect -f . node:6-alpine

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.39/containers/node:6-alpine/json: dial unix /var/run/docker.sock: connect: permission denied
The usual comment to address this is to do ---> sudo usermod -a -G docker $USER

But that is not an option in mac. Any suggestions?

Kind Regards.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

alcmaeon@gmail.com (JIRA)

unread,
Oct 20, 2019, 12:54:04 AM10/20/19
to jenkinsc...@googlegroups.com
Enrique Diaz edited a comment on Bug JENKINS-46799
That solved one issue, but now I get   the following problem:

+ docker inspect -f . node:6-alpine

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.39/containers/node:6-alpine/json]: dial unix /var/run/docker.sock: connect: permission denied
The usual comment to address this is to do ---> sudo usermod -a -G docker $USER

But that is not an option in mac. Any suggestions?

Kind Regards.

alcmaeon@gmail.com (JIRA)

unread,
Oct 20, 2019, 12:54:05 AM10/20/19
to jenkinsc...@googlegroups.com
Enrique Diaz edited a comment on Bug JENKINS-46799
That solved one issue, but now I get the following problem:

+ docker inspect -f . node:6-alpine

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.39/containers/node:6-alpine/json]: dial unix /var/run/docker.sock: connect: permission denied

-------------------------
The usual comment to address this is to do ---> sudo usermod -a -G docker $USER

But that is not an option in mac. Any suggestions?

Kind Regards.

alcmaeon@gmail.com (JIRA)

unread,
Oct 20, 2019, 12:55:03 AM10/20/19
to jenkinsc...@googlegroups.com
Enrique Diaz edited a comment on Bug JENKINS-46799
That solved one issue, but now I get the following problem:

+ docker inspect -f . node:6-alpine

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.39/containers/node:6-alpine/json]: dial unix /var/run/docker.sock: connect: permission denied [Pipeline] isUnix[Pipeline] sh

-------------------------
The usual comment to address this is to do ---> sudo usermod -a -G docker $USER

But that is not an option in mac. Any suggestions?

Kind Regards.
Reply all
Reply to author
Forward
0 new messages