[JIRA] (JENKINS-58712) Docker tool configuration over Jenkins slaves

5 views
Skip to first unread message

danielj@radware.com (JIRA)

unread,
Jul 29, 2019, 12:59:02 PM7/29/19
to jenkinsc...@googlegroups.com
Daniel Juravski created an issue
 
Jenkins / Bug JENKINS-58712
Docker tool configuration over Jenkins slaves
Issue Type: Bug Bug
Assignee: Nicolas De Loof
Components: docker-commons-plugin, docker-plugin
Created: 2019-07-29 16:58
Labels: jenkins plug-in docker
Priority: Critical Critical
Reporter: Daniel Juravski

Hi,

I'm using docker-commons-plugin v.1.13 and jenkins v.1.121.3

I have several ubuntu (16.04) slaves connected to my jenkins.

 

My goal is to configure Docker as a global tool, i.e be able to run docker commands without having any docker pkgs on my slaves.

I configured  the docker-commons-plugin and add it as it written at the GitHub README, but the only thing I able to do is $docker version

Any attempt to make something practical (i.e. docker build/run/push/...) is over with the following error:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

 

 

Once again, I do no want to install the docker pkg over my slaves, but only use the docker tool.

What can I do?

 

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

pjdarton@gmail.com (JIRA)

unread,
Sep 24, 2019, 11:44:03 AM9/24/19
to jenkinsc...@googlegroups.com
pjdarton assigned an issue to Unassigned
Change By: pjdarton
Assignee: Nicolas De Loof
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

pjdarton@gmail.com (JIRA)

unread,
Sep 24, 2019, 12:04:02 PM9/24/19
to jenkinsc...@googlegroups.com
pjdarton closed an issue as Not A Defect
 

It doesn't work that way...

Builds run on slave nodes.
If your slave nodes don't have the docker client on them and don't have access to a docker daemon then your slave nodes have no docker capabilities, which is why your attempts to use those missing capabilities are failing.
A machine without the docker daemon on it (and running) can't contain docker containers.
A machine without a docker client on it can't talk to a docker daemon about docker containers.

The docker-commons-plugin provides a Java docker client that's used by the docker-plugin to talk to docker daemons, but that capability is there for the Jenkins master and isn't really exposed to the slave nodes.

If you want to run docker commands as part of a build process on a build slave node then you need to have build slave nodes that have the docker client on them and they either a link to another docker daemon (whether that's via the DOCKER_HOST env var or by cross-mounting /var/lib/docker.sock from the docker host into a docker container) or (to keep things nice and simple and isolated) their own running docker daemon (less efficient, but much simpler as every build gets its own docker daemon, so you don't get nasty collisions).

TL;DR: If you want docker on your slave nodes, you need to install docker on your slave nodes.

Change By: pjdarton
Status: Open Closed
Resolution: Not A Defect
Reply all
Reply to author
Forward
0 new messages