SlideShare ist ein Scribd-Unternehmen logo
1 von 17
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?

Weitere ähnliche Inhalte

Was ist angesagt?

Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
dirtytactics
 
Jenkins and rails app - Le Dinh Vu
Jenkins and rails app - Le Dinh VuJenkins and rails app - Le Dinh Vu
Jenkins and rails app - Le Dinh Vu
Framgia Vietnam
 

Was ist angesagt? (20)

Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
 
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
 
Grooving with Jenkins
Grooving with JenkinsGrooving with Jenkins
Grooving with Jenkins
 
Hand Crafted Artisanal Chef Resources
Hand Crafted Artisanal Chef ResourcesHand Crafted Artisanal Chef Resources
Hand Crafted Artisanal Chef Resources
 
Introduction to Concourse CI #渋谷Java
Introduction to Concourse CI #渋谷JavaIntroduction to Concourse CI #渋谷Java
Introduction to Concourse CI #渋谷Java
 
Install Concourse CI with BOSH
Install Concourse CI with BOSHInstall Concourse CI with BOSH
Install Concourse CI with BOSH
 
Dockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber ExampleDockerizing BDD : Ruby-Cucumber Example
Dockerizing BDD : Ruby-Cucumber Example
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Code fast & Break things with Jenkins & Continuous Integration
Code fast & Break things with Jenkins & Continuous IntegrationCode fast & Break things with Jenkins & Continuous Integration
Code fast & Break things with Jenkins & Continuous Integration
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?
 
ChefConf 2016 - Writing Compossible Community Cookbooks using Chef Custom Res...
ChefConf 2016 - Writing Compossible Community Cookbooks using Chef Custom Res...ChefConf 2016 - Writing Compossible Community Cookbooks using Chef Custom Res...
ChefConf 2016 - Writing Compossible Community Cookbooks using Chef Custom Res...
 
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
20140924   3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)20140924   3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
Auto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSHAuto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSH
 
Hacking Maven Linux day 2017
Hacking Maven Linux day 2017Hacking Maven Linux day 2017
Hacking Maven Linux day 2017
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Keep Your Servers in GitHub
Keep Your Servers in GitHubKeep Your Servers in GitHub
Keep Your Servers in GitHub
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Jenkins and rails app - Le Dinh Vu
Jenkins and rails app - Le Dinh VuJenkins and rails app - Le Dinh Vu
Jenkins and rails app - Le Dinh Vu
 

Andere mochten auch

Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Carlos Sanchez
 

Andere mochten auch (14)

Dockerized maven
Dockerized mavenDockerized maven
Dockerized maven
 
What is this "docker"
What is this  "docker" What is this  "docker"
What is this "docker"
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
 
Testing Distributed Micro Services. Agile Testing Days 2017
Testing Distributed Micro Services. Agile Testing Days 2017Testing Distributed Micro Services. Agile Testing Days 2017
Testing Distributed Micro Services. Agile Testing Days 2017
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
 
TDC2016SP - Testes unitários e testes de integração de aplicações Java utiliz...
TDC2016SP - Testes unitários e testes de integração de aplicações Java utiliz...TDC2016SP - Testes unitários e testes de integração de aplicações Java utiliz...
TDC2016SP - Testes unitários e testes de integração de aplicações Java utiliz...
 
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
 
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Continuous Integration using Docker & Jenkins
Continuous Integration using Docker & JenkinsContinuous Integration using Docker & Jenkins
Continuous Integration using Docker & Jenkins
 
Jenkins Docker
Jenkins DockerJenkins Docker
Jenkins Docker
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 

Ähnlich wie Jenkins on Docker

Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Rashedul Islam
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
moirarandell
 

Ähnlich wie Jenkins on Docker (20)

Enabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @OrbitzEnabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
 
Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Extracting twitter data using apache flume
Extracting twitter data using apache flumeExtracting twitter data using apache flume
Extracting twitter data using apache flume
 
Continuous Delivery with Docker and Amazon ECS
Continuous Delivery with Docker and Amazon ECSContinuous Delivery with Docker and Amazon ECS
Continuous Delivery with Docker and Amazon ECS
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10Setup a Dev environment that feels like $HOME on Windows 10
Setup a Dev environment that feels like $HOME on Windows 10
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 
How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes How to push to production a project with 100+ plugins in less than 10 minutes
How to push to production a project with 100+ plugins in less than 10 minutes
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 

Mehr von Craig Trim

The art of tokenization
The art of tokenizationThe art of tokenization
The art of tokenization
Craig Trim
 

Mehr von Craig Trim (19)

Publishing Python to PyPI using Github Actions.pptx
Publishing Python to PyPI using Github Actions.pptxPublishing Python to PyPI using Github Actions.pptx
Publishing Python to PyPI using Github Actions.pptx
 
Ontologies and the Semantic Web
Ontologies and the Semantic WebOntologies and the Semantic Web
Ontologies and the Semantic Web
 
SAS Visual Process Flows
SAS Visual Process FlowsSAS Visual Process Flows
SAS Visual Process Flows
 
SAS University Edition - Getting Started
SAS University Edition - Getting StartedSAS University Edition - Getting Started
SAS University Edition - Getting Started
 
Bluemix NL Classifier Tutorial
Bluemix NL Classifier TutorialBluemix NL Classifier Tutorial
Bluemix NL Classifier Tutorial
 
Bluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web ApplicationBluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web Application
 
IBM Bluemix - Building a Project with Maven
IBM Bluemix - Building a Project with MavenIBM Bluemix - Building a Project with Maven
IBM Bluemix - Building a Project with Maven
 
Question Types in Natural Language Processing
Question Types in Natural Language ProcessingQuestion Types in Natural Language Processing
Question Types in Natural Language Processing
 
IBM Bluemix: Creating a Git Project
IBM Bluemix: Creating a Git ProjectIBM Bluemix: Creating a Git Project
IBM Bluemix: Creating a Git Project
 
Things and strings public
Things and strings   publicThings and strings   public
Things and strings public
 
Octave - Prototyping Machine Learning Algorithms
Octave - Prototyping Machine Learning AlgorithmsOctave - Prototyping Machine Learning Algorithms
Octave - Prototyping Machine Learning Algorithms
 
PROV Overview
PROV OverviewPROV Overview
PROV Overview
 
The Onomyicon
The OnomyiconThe Onomyicon
The Onomyicon
 
Dependency parsing (2013)
Dependency parsing (2013)Dependency parsing (2013)
Dependency parsing (2013)
 
Inference using owl 2.0 semantics
Inference using owl 2.0 semanticsInference using owl 2.0 semantics
Inference using owl 2.0 semantics
 
An Introduction to the Jena API
An Introduction to the Jena APIAn Introduction to the Jena API
An Introduction to the Jena API
 
The art of tokenization
The art of tokenizationThe art of tokenization
The art of tokenization
 
Deep Parsing (2012)
Deep Parsing (2012)Deep Parsing (2012)
Deep Parsing (2012)
 
Ontology and semantic web (2016)
Ontology and semantic web (2016)Ontology and semantic web (2016)
Ontology and semantic web (2016)
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Jenkins on Docker

  • 2. 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
  • 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?