0
votes

I have a jenkins setup with docker installed on the same host. I've read several tutorials that helps me create a slave as a docker container. so the pipeline of each branch will be performed on a docker container which acts as slave to the jenkins master. This works for a pipeline project, but for some reason it does not work for a multibranch project.

If I use the following pipeline script:

node('slave') {
  echo 'Hello World'
  sh 'docker info'

  sh 'sleep 20'
}

in a pipeline project where it expects a node with the name 'slave' it works and the docker-pipeline plugin starts the container. Using the same pipeline in a multibranch project doesn't seem to work. Nothing actually happens as jenkins is waiting for the next executor. No error in the log also

The docker pipeline plugin is configured correctly as it does show me the api version of docker and also performs as it should when using a pipelineproject.

The following image shows how the plugin is configured:

docker plugin

any idea what to do to fix this?

2

2 Answers

0
votes

Jenkins's cloud plugins generally wait up to 60 seconds before starting another slave if short on executors.

Is this not the case for you?

0
votes

probably there was something off as I started again from scratch and reconfigured everything. Now the containers get started also with multibranch projects.