Jenkins: a working collector does not provide docker subordinates

I am running Jenkins 1.609.1 with docker-plugin 0.10.0 to provide docker jenkins slave. Docker 1.0.1 runs on Ubuntu 14.04.

I created customized docker images based on evarga/jenkins-slave

for each instruction at https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin ("Shortcut: pulling docker image" ").

In my Jenkins configuration, I have:

  • added "Docker" to the "Cloud" area.
  • pointed to the local docker url http: // localhost: 4243 / and also configured docker accordingly (I can run a "test connection" and it reports "1.0.1")
  • created a custom docker image ( my/jenkins:0.1

    ) with supervisor to run SSH, MySQL, Postgres, ElasticSearch, PHP and NodeJS inside
  • manual container management, i can SSH with jenkins / jenkins user
  • I also gave jenkins user inside sudo password without password.
  • I added a docker image to the "Docker Template" (as above :) my/jenkins:0.1

    and provided a launch method with "Docker SSH launcher"

enter image description here

In the job configuration:

  • I checked the "docker container"
  • added my tag
  • source code is connected via git checkout

enter image description here

When I run the job, only the git checkout is done, not on the slave, but directly on the host:

Started by user MyUser
Building in workspace /var/lib/jenkins/workspace/Project-Core
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git@github.com:MyUser/Project-Core.git # timeout=10
Fetching upstream changes from git@github.com:MyUser/Project-Core.git
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git -c core.askpass=true fetch --tags --progress git@github.com:MyUser/Project-Core.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 96dcbc7aa615451448184493c499c14eeb7050cc (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 96dcbc7aa615451448184493c499c14eeb7050cc
 > git rev-list 1405ab6d96a395e53c80f6d7353e11bea93675bc # timeout=10
Finished: SUCCESS

      

There is no sign of even trying to secure a slave slave.

What am I missing?

+3


source to share


2 answers


I could solve this problem thanks to the answer on the jenkinsci mailing list :

The "shortcut" added to the global configuration "Docker template" should be used in the "Limit where this project can run" field in the job configuration.

I mistakenly added it to the "Docker Container / Additional tag to add" field.



On the side: I was using Docker 1.10.0 which, after fixing the above, now worked with the setup, I got:

Configuration error; template = 'DockerTemplate {labelString =' jenkins', launcher = com.n irima.jenkins.plugins.docker.launcher.DockerComputerSSHLauncher @ 28c3da52, remoteFsMapping = '', remoteFs = '/ home / jenkins', instanceCap = 2147483647, mode NORMAL, retentionStrategy = com.nir ima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy @ 1ccaa52c, numExecutors = 1, dockerTemplateBase = DockerTemplateBase {image = jenkins: 0.3}} 'com.github.dockerExternalJava.aperception container b35c3d99a13b8b6365cd79a90b9fa65d3b3780b63a5a8d2683853583e81885ee: write / sys / fs / cgroup / cpuset / docker / b 35c3d99a13b8b6365cd79a90b9fa65d5a37e / db63set: wrong argument

Upgrading to the latest version, 1.7.1 in my case, fixed this immediately.

+1


source


You have configured your work to run on a Docker slave. I am guessing this might be a problem, since as per your expression, it runs on the main server.

More details can be found on customizing the docker image from one of my posts here.



http://www.scmtechblog.net/2016/01/setup-docker-slaves-for-jenkins.html

0


source







All Articles