Skip to content

tatyanavych/jenkins-dind-agent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins Docker-in-Docker Agent

Docker Stars Docker Pulls

A simple Docker image for running a Jenkins agent with its very own contained Docker daemon. This is useful if you're trying to run Jenkins agents on a Mesos cluster, and you also want to build and push Docker images with Jenkins agents.

Usage

Command line

Try it out locally by running the following command:

docker run --privileged beedemo/jenkins-dind-agent \
  wrapper.sh "java -version && docker run hello-world"

Jenkins

You'll need to configure the Mesos plugin on your Jenkins master to use this image. You'll probably also want to give it a special slave label, so that you don't unnecessarily run builds using the dind image. A relevant snippet of the Mesos plugin within the Jenkins master's config.xml follows:

<org.jenkinsci.plugins.mesos.MesosSlaveInfo>
  <slaveCpus>0.2</slaveCpus>
  <slaveMem>512</slaveMem>
  <executorCpus>0.1</executorCpus>
  <maxExecutors>2</maxExecutors>
  <executorMem>128</executorMem>
  <remoteFSRoot>jenkins</remoteFSRoot>
  <idleTerminationMinutes>3</idleTerminationMinutes>
  <jvmArgs>
    -Xms16m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true
  </jvmArgs>
  <jnlpArgs/>
  <containerInfo>
    <type>DOCKER</type>
    <dockerImage>beedemo/jenkins-dind-agent:1.13.1-alpine</dockerImage>
    <networking>BRIDGE</networking>
    <useCustomDockerCommandShell>true</useCustomDockerCommandShell>
    <customDockerCommandShell>wrapper.sh</customDockerCommandShell>
    <dockerPrivilegedMode>true</dockerPrivilegedMode>
    <dockerForcePullImage>false</dockerForcePullImage>
  </containerInfo>
  <mode>NORMAL</mode>
  <labelString>dind</labelString>
</org.jenkinsci.plugins.mesos.MesosSlaveInfo>

About

Jenkins Docker-in-Docker agent

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%