Jenkins trigger on-demand slaves in dockers

好久不见. 提交于 2019-12-01 08:57:07
  1. Docker slave image creation steps like installing openssh, user creation, mentioned in the below link. Install docker plugin from the below link.

    Click here!

  2. Go to jenkins global configuration, Under cloud headings, docker configuration will be there, enter docker host url with port number, credential not required. give some values for connection timeout & read timeout.

  3. Under docker template - Enter the docker image name which we created in the point number 1.

  4. Set Label number (Give this label name during Jenkins job creation and restrict to this slave name),

  5. Select the usage option - > only build job with label restriction.

  6. No of executor -> minimum 1. Select launch method as ssh, enter the user credential to login, which we created in docker image in the step number 1.

create a job restrict to docker slave label, run, ondemand it wil spun up container.

Use this plugin: https://wiki.jenkins-ci.org/display/JENKINS/Yet+Another+Docker+Plugin

After instalation (it requires Java 1.8) naviaget to configuration. There are two steps:

  1. configure docker "cloud"
  2. add "instances" (docker images) you want to run the build on

Every image should have label assigned - use this label in you job configuration to tell Jenkins explicitlyon which node the job should be run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!