SlideShare a Scribd company logo
Jenkins on Docker
craigtrim@gmail.com
Extend
FROM jenkins
MAINTAINER Craig Trim "craigtrim@gmail.com"
ENV MAVEN_HOME /usr/lib/apache/maven/3.3.1
ENV PATH /usr/lib/apache/maven/3.3.1/bin:$PATH
USER root
RUN export DEBIAN_FRONTEND=noninteractive && 
apt-get update
RUN 
mkdir -p $MAVEN_HOME && 
cd $MAVEN_HOME && 
wget http://mirrors.ibiblio.org/apache/maven/maven-
3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz && 
tar -zxvf apache-maven-3.3.1-bin.tar.gz && 
mv apache-maven-3.3.1/* . && 
rm -rf apache-maven-3.3.1
USER jenkins
• Extend the official docker Jenkins file to
install Maven
• Official Image
• https://registry.hub.docker.com/_/jenkins/
• Extended Image
• https://github.com/torrances/docker/tree/master/jenkins
Build and Launch
• Build the docker image
• “craig/jenkins“
• Launch a container
• Expose on port 8040 (arbitrary)
• -p 8040:8080
• Inject a host directory
• This will contain all the Jenkins
customizations: build configurations,
credentials, workspace and built artifacts
• Around 130 MB immediately, and can
become very large over time
• -v ~/jpr:/var/jenkins_home
• Code is on the next page
• I like to use a shell script that handles any
host system manipulation and then calls
a docker-compose script
Docker (and docker-compose) installation script:
https://github.com/torrances/bash/blob/master/install/docker.sh
Build and Launch
docker-compose.yml
jenkins:
build: .
ports:
- "8040:8080"
volumes:
- ~/jpr:/var/jenkins_home
hostname:
jenkins
privileged:
false
run.sh
mkdir ~/jpr
sudo docker-compose up
View
• Pull up a web browser!
Further Configuration (creating new jobs):
http://trimc-devops.blogspot.com/p/masterpage.html#jenkins
Add Maven
Installation
• Click on Manage Jenkins
Add Maven
Installation
• Click on Configure System
Add Maven
Installation
• Scroll down
• Click the Add Maven button
• Unselect the Install automatically
checkbox
• In the Name textbox, put maven
• In the MAVEN_HOME textbox, enter the
path from the Dockerfile
(/usr/lib/apache/maven/3.3.1)
• Click Save
Maven Installation and Usage:
http://trimc-devops.blogspot.com/p/masterpage.html#maven
Install the Git Plugin
• Go back to the dashboard
• Select Manage Jenkins from the left-hand
nav
• Select Manage Plugins from the list
Install the Git Plugin
• Click on the Available tab
• Type github in the Filter text area
Install the Git Plugin
• Scroll down and select Github Plugin
• Click Install without restart
Install the Git Plugin
• Wait for the installation to complete
Install the Git Plugin
• Wait for the installation to complete
Install the Git Plugin
• Once the installation is complete, check
the Restart Jenkins when installation is
complete and no jobs are running
checkbox
Install the Git Plugin
• This will immediately restart Jenkins
Thanks!
Things that I haven’t got around to doing yet …
• Look into the use of a docker host to dynamically provision a slave,
run a single build, and tear down the host:
• https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin
• Install plugins (like Git) dynamically
• https://registry.hub.docker.com/_/jenkins/
• Do I need to install Maven on Docker first, or can this be installed
automatically when Jenkins initializes?

More Related Content

What's hot (20)

PDF
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Gareth Bowles
 
PDF
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
Publicis Sapient Engineering
 
PPTX
Grooving with Jenkins
Anton Weiss
 
PDF
Hand Crafted Artisanal Chef Resources
Sean OMeara
 
PDF
Introduction to Concourse CI #渋谷Java
Toshiaki Maki
 
PDF
Install Concourse CI with BOSH
Toshiaki Maki
 
PPT
Dockerizing BDD : Ruby-Cucumber Example
Shashikant Jagtap
 
PDF
Server(less) Swift at SwiftCloudWorkshop 3
kognate
 
PDF
Code fast & Break things with Jenkins & Continuous Integration
Hervé Vũ Roussel
 
PPTX
Where is my scalable api?
Altoros
 
PDF
ChefConf 2016 - Writing Compossible Community Cookbooks using Chef Custom Res...
Tim Smith
 
PPTX
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
Filipe MS Bento
 
PPTX
Tutorial 1: Your First Science App - Araport Developer Workshop
Vivek Krishnakumar
 
PDF
Auto-scaled Concourse CI on AWS w/o BOSH
佑介 九岡
 
PDF
Hacking Maven Linux day 2017
Massimiliano Dessì
 
PDF
Building a Drupal site with Git
dirtytactics
 
PDF
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
Development Seed
 
PDF
Keep Your Servers in GitHub
Yegor Bugayenko
 
PDF
.Git for WordPress Developers
mpvanwinkle
 
ODP
Jenkins and rails app - Le Dinh Vu
Framgia Vietnam
 
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Gareth Bowles
 
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
Publicis Sapient Engineering
 
Grooving with Jenkins
Anton Weiss
 
Hand Crafted Artisanal Chef Resources
Sean OMeara
 
Introduction to Concourse CI #渋谷Java
Toshiaki Maki
 
Install Concourse CI with BOSH
Toshiaki Maki
 
Dockerizing BDD : Ruby-Cucumber Example
Shashikant Jagtap
 
Server(less) Swift at SwiftCloudWorkshop 3
kognate
 
Code fast & Break things with Jenkins & Continuous Integration
Hervé Vũ Roussel
 
Where is my scalable api?
Altoros
 
ChefConf 2016 - Writing Compossible Community Cookbooks using Chef Custom Res...
Tim Smith
 
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
Filipe MS Bento
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Vivek Krishnakumar
 
Auto-scaled Concourse CI on AWS w/o BOSH
佑介 九岡
 
Hacking Maven Linux day 2017
Massimiliano Dessì
 
Building a Drupal site with Git
dirtytactics
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
Development Seed
 
Keep Your Servers in GitHub
Yegor Bugayenko
 
.Git for WordPress Developers
mpvanwinkle
 
Jenkins and rails app - Le Dinh Vu
Framgia Vietnam
 

Viewers also liked (14)

PDF
Dockerized maven
Matthias Bertschy
 
PDF
What is this "docker"
Jean-Marc Meessen
 
PDF
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
PDF
Testing Distributed Micro Services. Agile Testing Days 2017
Carlos Sanchez
 
PPTX
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
NLJUG
 
PPTX
TDC2016SP - Testes unitários e testes de integração de aplicações Java utiliz...
tdc-globalcode
 
PDF
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Carlos Sanchez
 
PDF
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Carlos Sanchez
 
PDF
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
PDF
Continuous Integration using Docker & Jenkins
B1 Systems GmbH
 
PDF
Jenkins Docker
Alex Soto
 
PDF
Using Docker for Testing
Carlos Sanchez
 
PDF
Docker for Java Developers
Imesh Gunaratne
 
PPTX
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Dockerized maven
Matthias Bertschy
 
What is this "docker"
Jean-Marc Meessen
 
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
Testing Distributed Micro Services. Agile Testing Days 2017
Carlos Sanchez
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
NLJUG
 
TDC2016SP - Testes unitários e testes de integração de aplicações Java utiliz...
tdc-globalcode
 
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Carlos Sanchez
 
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Carlos Sanchez
 
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
Continuous Integration using Docker & Jenkins
B1 Systems GmbH
 
Jenkins Docker
Alex Soto
 
Using Docker for Testing
Carlos Sanchez
 
Docker for Java Developers
Imesh Gunaratne
 
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Ad

Similar to Jenkins on Docker (20)

PPTX
Kubernetes Jenkins Docker Deployments on Google Cloud k8s in Jenkins Meetup G...
Girish Dudhwal
 
PDF
Testing Ansible with Jenkins and Docker
Dennis Rowe
 
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
PDF
Pimp your jenkins platform with docker - Devops.com 2015/11
CloudBees
 
PPTX
Jenkins & scriptable build
Bryan Liu
 
PDF
Slides 29-07-2017
Soumyak Bhattacharyya
 
PPTX
Javaone 2014 - Git & Docker with Jenkins
Andy Pemberton
 
PPTX
Continuous integration jenkins-installation in ec2 instace linux
Maheshnagakumar Tokala
 
PDF
Exploring Docker in CI/CD
Henry Huang
 
PDF
Jenkins Tutorial.pdf
devtestervicky
 
PDF
Continuous Integration/Deployment with Docker and Jenkins
Francesco Bruni
 
PDF
Introduction to jenkins
Krish
 
PDF
How to Install and Configure Jenkins on Centos 7
AniketGoyal14
 
PDF
Docker + jenkins in the enterprise (3)
Kurt Madel
 
PDF
Jenkins_Online_Meetup-Jenkins_Kubernetes_Operator.pdf
Albert Wang
 
PDF
Take control of your Jenkins jobs via job DSL.
Łukasz Proszek
 
PPTX
Docker and Jenkins [as code]
Mark Waite
 
PDF
Jenkins log monitoring with elk stack
Subhasis Roy
 
PDF
Software industrialization
Bibek Lama
 
PPTX
Jenkins advance topic
Gourav Varma
 
Kubernetes Jenkins Docker Deployments on Google Cloud k8s in Jenkins Meetup G...
Girish Dudhwal
 
Testing Ansible with Jenkins and Docker
Dennis Rowe
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Pimp your jenkins platform with docker - Devops.com 2015/11
CloudBees
 
Jenkins & scriptable build
Bryan Liu
 
Slides 29-07-2017
Soumyak Bhattacharyya
 
Javaone 2014 - Git & Docker with Jenkins
Andy Pemberton
 
Continuous integration jenkins-installation in ec2 instace linux
Maheshnagakumar Tokala
 
Exploring Docker in CI/CD
Henry Huang
 
Jenkins Tutorial.pdf
devtestervicky
 
Continuous Integration/Deployment with Docker and Jenkins
Francesco Bruni
 
Introduction to jenkins
Krish
 
How to Install and Configure Jenkins on Centos 7
AniketGoyal14
 
Docker + jenkins in the enterprise (3)
Kurt Madel
 
Jenkins_Online_Meetup-Jenkins_Kubernetes_Operator.pdf
Albert Wang
 
Take control of your Jenkins jobs via job DSL.
Łukasz Proszek
 
Docker and Jenkins [as code]
Mark Waite
 
Jenkins log monitoring with elk stack
Subhasis Roy
 
Software industrialization
Bibek Lama
 
Jenkins advance topic
Gourav Varma
 
Ad

More from Craig Trim (19)

PPTX
Publishing Python to PyPI using Github Actions.pptx
Craig Trim
 
PPT
Ontologies and the Semantic Web
Craig Trim
 
PPTX
SAS Visual Process Flows
Craig Trim
 
PPTX
SAS University Edition - Getting Started
Craig Trim
 
PPTX
Bluemix NL Classifier Tutorial
Craig Trim
 
PPTX
Bluemix - Deploying a Java Web Application
Craig Trim
 
PPTX
IBM Bluemix - Building a Project with Maven
Craig Trim
 
PPTX
Question Types in Natural Language Processing
Craig Trim
 
PPTX
IBM Bluemix: Creating a Git Project
Craig Trim
 
PPTX
Things and strings public
Craig Trim
 
PPT
Octave - Prototyping Machine Learning Algorithms
Craig Trim
 
PPT
PROV Overview
Craig Trim
 
PPT
The Onomyicon
Craig Trim
 
PPT
Dependency parsing (2013)
Craig Trim
 
PPT
Inference using owl 2.0 semantics
Craig Trim
 
PDF
An Introduction to the Jena API
Craig Trim
 
PDF
The art of tokenization
Craig Trim
 
PPT
Deep Parsing (2012)
Craig Trim
 
PPT
Ontology and semantic web (2016)
Craig Trim
 
Publishing Python to PyPI using Github Actions.pptx
Craig Trim
 
Ontologies and the Semantic Web
Craig Trim
 
SAS Visual Process Flows
Craig Trim
 
SAS University Edition - Getting Started
Craig Trim
 
Bluemix NL Classifier Tutorial
Craig Trim
 
Bluemix - Deploying a Java Web Application
Craig Trim
 
IBM Bluemix - Building a Project with Maven
Craig Trim
 
Question Types in Natural Language Processing
Craig Trim
 
IBM Bluemix: Creating a Git Project
Craig Trim
 
Things and strings public
Craig Trim
 
Octave - Prototyping Machine Learning Algorithms
Craig Trim
 
PROV Overview
Craig Trim
 
The Onomyicon
Craig Trim
 
Dependency parsing (2013)
Craig Trim
 
Inference using owl 2.0 semantics
Craig Trim
 
An Introduction to the Jena API
Craig Trim
 
The art of tokenization
Craig Trim
 
Deep Parsing (2012)
Craig Trim
 
Ontology and semantic web (2016)
Craig Trim
 

Recently uploaded (20)

PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Python basic programing language for automation
DanialHabibi2
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 

Jenkins on Docker

  • 2. Extend FROM jenkins MAINTAINER Craig Trim "[email protected]" ENV MAVEN_HOME /usr/lib/apache/maven/3.3.1 ENV PATH /usr/lib/apache/maven/3.3.1/bin:$PATH USER root RUN export DEBIAN_FRONTEND=noninteractive && apt-get update RUN mkdir -p $MAVEN_HOME && cd $MAVEN_HOME && wget http://mirrors.ibiblio.org/apache/maven/maven- 3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz && tar -zxvf apache-maven-3.3.1-bin.tar.gz && mv apache-maven-3.3.1/* . && rm -rf apache-maven-3.3.1 USER jenkins • Extend the official docker Jenkins file to install Maven • Official Image • https://registry.hub.docker.com/_/jenkins/ • Extended Image • https://github.com/torrances/docker/tree/master/jenkins
  • 3. Build and Launch • Build the docker image • “craig/jenkins“ • Launch a container • Expose on port 8040 (arbitrary) • -p 8040:8080 • Inject a host directory • This will contain all the Jenkins customizations: build configurations, credentials, workspace and built artifacts • Around 130 MB immediately, and can become very large over time • -v ~/jpr:/var/jenkins_home • Code is on the next page • I like to use a shell script that handles any host system manipulation and then calls a docker-compose script Docker (and docker-compose) installation script: https://github.com/torrances/bash/blob/master/install/docker.sh
  • 4. Build and Launch docker-compose.yml jenkins: build: . ports: - "8040:8080" volumes: - ~/jpr:/var/jenkins_home hostname: jenkins privileged: false run.sh mkdir ~/jpr sudo docker-compose up
  • 5. View • Pull up a web browser! Further Configuration (creating new jobs): http://trimc-devops.blogspot.com/p/masterpage.html#jenkins
  • 7. Add Maven Installation • Click on Configure System
  • 8. Add Maven Installation • Scroll down • Click the Add Maven button • Unselect the Install automatically checkbox • In the Name textbox, put maven • In the MAVEN_HOME textbox, enter the path from the Dockerfile (/usr/lib/apache/maven/3.3.1) • Click Save Maven Installation and Usage: http://trimc-devops.blogspot.com/p/masterpage.html#maven
  • 9. Install the Git Plugin • Go back to the dashboard • Select Manage Jenkins from the left-hand nav • Select Manage Plugins from the list
  • 10. Install the Git Plugin • Click on the Available tab • Type github in the Filter text area
  • 11. Install the Git Plugin • Scroll down and select Github Plugin • Click Install without restart
  • 12. Install the Git Plugin • Wait for the installation to complete
  • 13. Install the Git Plugin • Wait for the installation to complete
  • 14. Install the Git Plugin • Once the installation is complete, check the Restart Jenkins when installation is complete and no jobs are running checkbox
  • 15. Install the Git Plugin • This will immediately restart Jenkins
  • 17. Things that I haven’t got around to doing yet … • Look into the use of a docker host to dynamically provision a slave, run a single build, and tear down the host: • https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin • Install plugins (like Git) dynamically • https://registry.hub.docker.com/_/jenkins/ • Do I need to install Maven on Docker first, or can this be installed automatically when Jenkins initializes?