NotSoShabby
NotSoShabby

Reputation: 3728

Making docker container a build executor for jenkins

I have a ec2 instance running as my jenkins master. I would like to run a container in that instance that will be used as another build executor so I can tun a few builds simultaneously.

Im having pronblems connecting these.

In the docker hub jenkins docs it says under the relevant section:

You can run builds on the master out of the box.

But if you want to attach build slave servers through JNLP (Java Web Start): make sure you map the port: -p 50000:50000 - which will be used when you connect a slave agent.

If you are only using SSH slaves, then you do NOT need to put that port mapping.

but when I try to add a node in the jenkins config, it asks remote root directory (probably should be /var/jenkins ? ) and a launch method.

I don't quite understand what I should give it as its launch method to make this work and I don't understand where the port number comes into play.

Upvotes: 0

Views: 4108

Answers (1)

ben5556
ben5556

Reputation: 3018

What you need is Jenkins Docker plugin (link below) and follow the instructions listed here

https://wiki.jenkins.io/display/JENKINS/Docker+Plugin

I followed those instructions and was able to setup dynamic slaves in Jenkins which are dynamically provisioned.

Upvotes: 2

Related Questions