SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Introduction The pipeline The environment The images The problems Finish
Using Docker in CI process
Applied Docker
G. Godlewski
March 16, 2016
Introduction The pipeline The environment The images The problems Finish
Author
About me
Programming, karate, music and cheese making.
Currently working for SMT Software Services
Introduction The pipeline The environment The images The problems Finish
The background
Long time ago, in a galaxy far, far away...
Introduction The pipeline The environment The images The problems Finish
The background
Introduction The pipeline The environment The images The problems Finish
The background
Scope of automation
Unit tests
Functional tests
Integration tests
Quality checks (nightly build, code coverage, phpmd, phpcs,
jshint, jslint, ...)
Deployments
One should constantly search for spots where time could be saved
Introduction The pipeline The environment The images The problems Finish
DeïŹnitions
Continuous Integration
Martin Fowler:
Continuous Integration is a software development
practice where members of a team integrate their
work frequently, usually each person integrates at least
daily - leading to multiple integrations per day. Each
integration is veriïŹed by an automated build (including
test) to detect integration errors as quickly as possible.
Introduction The pipeline The environment The images The problems Finish
DeïŹnitions
Continuous Delivery
Martin Fowler:
A common question we hear is “what is the diïŹ€erence
between Continuous Delivery and Continuous
Deployment?” Both terms are similar and were coined
around the same time. I see the diïŹ€erence as a business
decision about frequency of deployment into production.
Continuous Delivery is about keeping your application
in a state where it is always able to deploy into
production. Continuous Deployment is actually
deploying every change into production, every day or
more frequently.
Introduction The pipeline The environment The images The problems Finish
Product
The point of view
Introduction The pipeline The environment The images The problems Finish
Process
The process
Building - parts put together, diagnostics and veriïŹcation,
removal of unnecessary parts
Packaging - a ready product is being put into a package
(container)
Delivery - the whole package is shipped to the client in a
clearly deïŹned manner
Each of the stages has a clear I/O deïŹnition
Introduction The pipeline The environment The images The problems Finish
Process
Building up a complete solution
In case of a product composed from several components (eg.
complex system) we could use the analogy of buying kitchen
furniture.
All packages contain components that fulïŹll a deïŹned set of
criteria
We know how the components should be connected
We know how the components should be placed within
client’s infrastructure (kitchen)
Don’t dismiss the power of analogy!
Introduction The pipeline The environment The images The problems Finish
Warming up!
What will we use Docker for
Performing CI builds within isolated containers (docker in
docker, sic!)
Providing the package for the product in which will it be
further distributed
Running our applications
Introduction The pipeline The environment The images The problems Finish
Warming up!
Introduction The pipeline The environment The images The problems Finish
Warming up!
Getting ready
1 Ensure the right kernel version (starting from 3.10!)
2 Ensure you have all required kernel modules (aufs,
devicemapper etc - depends on the distribution)
3 Latest docker-engine installed
4 Latest docker-compose installed
Introduction The pipeline The environment The images The problems Finish
Additional tools
Ansible
What for?
Describe how the application should be delivered (deployment
to server)
ConïŹguration management
Why?
Great documentation
Huge amount of modules - I didn’t have to build my own yet!
Introduction The pipeline The environment The images The problems Finish
Own Docker Hub
Docker Hub
hub:
restart: always
image: registry:2
ports:
- "5000:5000"
environment:
TERM: linux
REGISTRY_HTTP_TLS_CERTIFICATE: :)
REGISTRY_HTTP_TLS_KEY: :)
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
volumes:
- "/home/docker-distro/registry/data:/var/lib/registry"
- "/etc/ssl/certs:/certs"
- "/etc/ssl/private:/keys"
- "/home/docker-distro/registry/auth:/auth"
Hint
Keep security in mind!
Introduction The pipeline The environment The images The problems Finish
The CI Server
TeamCity
Free version provides:
3 build agents
20 build conïŹgurations
Broad conïŹguration capabilities (build parameters,
conïŹguration templates, deïŹning dependencies etc)
Introduction The pipeline The environment The images The problems Finish
Understanding CI
Build Server and Build Agents
Introduction The pipeline The environment The images The problems Finish
Customs
Special forces
Introduction The pipeline The environment The images The problems Finish
Customs
Custom Agent
FROM sjoerdmulder/teamcity-agent:latest
MAINTAINER Grzegorz Godlewski <grzegorz@sorcerystudio.com>
RUN apt-get -y install software-properties-common
RUN apt-add-repository ppa:ansible/ansible
RUN apt-get update
RUN apt-get -y install ansible
COPY ./keys/id_rsa /home/teamcity/.ssh/id_rsa
RUN chown -R teamcity:teamcity /home/teamcity/.ssh
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod a+x docker-entrypoint.sh
Introduction The pipeline The environment The images The problems Finish
Customs
Extending the images
Introduction The pipeline The environment The images The problems Finish
Implementation
TeamCity Server
server:
image: "sjoerdmulder/teamcity:latest"
ports:
- "8111:8111"
volumes:
- "/home/teamcity/server/data:/var/lib/teamcity"
environment:
TERM: linux
Introduction The pipeline The environment The images The problems Finish
Implementation
TeamCity Agent
agent:
image: "my-own-hub/teamcity-agent:latest"
ports:
- "9090:9090"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock" # docker in docker
- "/usr/bin/docker:/usr/bin/docker"
- "/usr/bin/docker:/usr/local/bin/docker"
- "/home/teamcity/agent/work:/opt/buildAgent/work" # work directories
- "/home/teamcity/agent/composer:/opt/composer/cache" # composer cache
- "/home/teamcity/agent/docker:/home/teamcity/.docker" # hub auth keys
environment:
TERM: linux
TEAMCITY_SERVER: "http://teamcity_server:8111" # your server
TEAMCITY_AGENT_NAME: "Alpha" # readable name
AGENT_HOME_ON_HOST: "/home/teamcity/agent" # custom ENV for runtime
Introduction The pipeline The environment The images The problems Finish
Implementation
The ïŹ‚ow
1 Run build in dev image
2 Package using dist image
3 Distribute using Ansible and docker-compose
Introduction The pipeline The environment The images The problems Finish
It’s never that easy
Not so easy...
Cleaning up
CI process performance
Proper kernel modules
Dynamically linked modules
Race conditions
Introduction The pipeline The environment The images The problems Finish
It’s never that easy
https://github.com/docker/docker/issues/4036
Introduction The pipeline The environment The images The problems Finish
It’s never that easy
https://github.com/docker/docker/issues/4036
If you’re using the devicemapper diver, make sure that Udev Sync
Supported is set to true.
Introduction The pipeline The environment The images The problems Finish
Questions?
Introduction The pipeline The environment The images The problems Finish
Thank you!
http://linkedin.com/in/ggodlewski
grzegorz@sorcerystudio.com
@GGodlewski

Weitere Àhnliche Inhalte

Was ist angesagt?

DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
Simplilearn
 
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
Simplilearn
 

Was ist angesagt? (20)

Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 
CI/CD 101
CI/CD 101CI/CD 101
CI/CD 101
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
Easy Cross-Platform PowerShell Automation with Puppet Bolt
Easy Cross-Platform PowerShell Automation with Puppet BoltEasy Cross-Platform PowerShell Automation with Puppet Bolt
Easy Cross-Platform PowerShell Automation with Puppet Bolt
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
 
Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-Pipelines
 
Patterns & Antipatterns in Docker Image Lifecycle
Patterns & Antipatterns in Docker Image LifecyclePatterns & Antipatterns in Docker Image Lifecycle
Patterns & Antipatterns in Docker Image Lifecycle
 
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
 
Scaling Up Lookout
Scaling Up LookoutScaling Up Lookout
Scaling Up Lookout
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 
Provisioning environments. A simplistic approach
Provisioning  environments. A simplistic approachProvisioning  environments. A simplistic approach
Provisioning environments. A simplistic approach
 
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
 
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as codeVoxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
 
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
What is Puppet? | How Puppet Works? | Puppet Tutorial For Beginners | DevOps ...
 
Devops interview questions 2 www.bigclasses.com
Devops interview questions  2  www.bigclasses.comDevops interview questions  2  www.bigclasses.com
Devops interview questions 2 www.bigclasses.com
 
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
PuppetConf 2016: Continuous Delivery and DevOps with Jenkins and Puppet Enter...
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
 
Distributed Version Control Systems
Distributed Version Control SystemsDistributed Version Control Systems
Distributed Version Control Systems
 

Andere mochten auch

Balie Mona Curriculum Vitae
Balie  Mona Curriculum VitaeBalie  Mona Curriculum Vitae
Balie Mona Curriculum Vitae
Balise Joni
 
9781119101987RetailNetworksForDummies_15954 (1)
9781119101987RetailNetworksForDummies_15954 (1)9781119101987RetailNetworksForDummies_15954 (1)
9781119101987RetailNetworksForDummies_15954 (1)
Alec Thorkelson
 
Flick Film FestivalInternship
Flick Film FestivalInternshipFlick Film FestivalInternship
Flick Film FestivalInternship
Kayla Kehler
 
BVPresentation
BVPresentationBVPresentation
BVPresentation
Ben Arditi
 
LTRSEC-2017-LG
LTRSEC-2017-LGLTRSEC-2017-LG
LTRSEC-2017-LG
Gurudatt pai
 
Unofficial Transcript
Unofficial TranscriptUnofficial Transcript
Unofficial Transcript
Logan Schmidt
 
klinik medika edukasi PJK
klinik medika edukasi PJKklinik medika edukasi PJK
klinik medika edukasi PJK
Adisty Nurul Husna
 
Presentation to Corporate-chain business (1)
Presentation to Corporate-chain business (1)Presentation to Corporate-chain business (1)
Presentation to Corporate-chain business (1)
Emily Parfet
 

Andere mochten auch (20)

LES ANNEES 1960 EN FRANCE ET EN ITALIE
LES ANNEES 1960 EN FRANCE ET EN ITALIELES ANNEES 1960 EN FRANCE ET EN ITALIE
LES ANNEES 1960 EN FRANCE ET EN ITALIE
 
CI oraz CD w zƂoĆŒonym projekcie o maƂym budĆŒecie
CI oraz CD w zƂoĆŒonym projekcie o maƂym budĆŒecieCI oraz CD w zƂoĆŒonym projekcie o maƂym budĆŒecie
CI oraz CD w zƂoĆŒonym projekcie o maƂym budĆŒecie
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
 
Tese
TeseTese
Tese
 
Balie Mona Curriculum Vitae
Balie  Mona Curriculum VitaeBalie  Mona Curriculum Vitae
Balie Mona Curriculum Vitae
 
Stress and reproduction
Stress and reproductionStress and reproduction
Stress and reproduction
 
POL 215 tutors Absolute Tutors / pol215tutors.com
POL 215 tutors Absolute Tutors / pol215tutors.comPOL 215 tutors Absolute Tutors / pol215tutors.com
POL 215 tutors Absolute Tutors / pol215tutors.com
 
Future of data center french
Future of data center frenchFuture of data center french
Future of data center french
 
Presentazione Club4business
Presentazione Club4businessPresentazione Club4business
Presentazione Club4business
 
Question 3
Question 3 Question 3
Question 3
 
9781119101987RetailNetworksForDummies_15954 (1)
9781119101987RetailNetworksForDummies_15954 (1)9781119101987RetailNetworksForDummies_15954 (1)
9781119101987RetailNetworksForDummies_15954 (1)
 
Flick Film FestivalInternship
Flick Film FestivalInternshipFlick Film FestivalInternship
Flick Film FestivalInternship
 
BVPresentation
BVPresentationBVPresentation
BVPresentation
 
LTRSEC-2017-LG
LTRSEC-2017-LGLTRSEC-2017-LG
LTRSEC-2017-LG
 
Nowe normy kontroli w instytucjach finansowych
Nowe normy kontroli w instytucjach finansowychNowe normy kontroli w instytucjach finansowych
Nowe normy kontroli w instytucjach finansowych
 
Hero moto corp km
Hero moto corp kmHero moto corp km
Hero moto corp km
 
ïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒ LE FEMINISME EN FRANCE E...
ïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒ LE FEMINISME EN FRANCE E...ïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒ LE FEMINISME EN FRANCE E...
ïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒïżŒ LE FEMINISME EN FRANCE E...
 
Unofficial Transcript
Unofficial TranscriptUnofficial Transcript
Unofficial Transcript
 
klinik medika edukasi PJK
klinik medika edukasi PJKklinik medika edukasi PJK
klinik medika edukasi PJK
 
Presentation to Corporate-chain business (1)
Presentation to Corporate-chain business (1)Presentation to Corporate-chain business (1)
Presentation to Corporate-chain business (1)
 

Ähnlich wie Using Docker in CI process

Ähnlich wie Using Docker in CI process (20)

CI/CD Pipeline with Docker
CI/CD Pipeline with DockerCI/CD Pipeline with Docker
CI/CD Pipeline with Docker
 
The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...
The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...
The Evolution of Agile - Continuous Delivery - Extending Agile out to Product...
 
Continuous Integration & Development with Gitlab
Continuous Integration & Development with GitlabContinuous Integration & Development with Gitlab
Continuous Integration & Development with Gitlab
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
 
CI/CD
CI/CDCI/CD
CI/CD
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applications
 
Continuous Everything
Continuous EverythingContinuous Everything
Continuous Everything
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon Otto
 
Taking Docker to Dance: Continuous Delivery on AWS
Taking Docker to Dance: Continuous Delivery on AWSTaking Docker to Dance: Continuous Delivery on AWS
Taking Docker to Dance: Continuous Delivery on AWS
 
Advanced Techniques for Initiating the DevOps Journey
Advanced Techniques for Initiating the DevOps JourneyAdvanced Techniques for Initiating the DevOps Journey
Advanced Techniques for Initiating the DevOps Journey
 
Word press, the automated way
Word press, the automated wayWord press, the automated way
Word press, the automated way
 
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with ConcourseContinuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
 
Docker and stuff
Docker and stuffDocker and stuff
Docker and stuff
 
Docker Meetup at Docker HQ: Docker Cloud
Docker Meetup at Docker HQ: Docker CloudDocker Meetup at Docker HQ: Docker Cloud
Docker Meetup at Docker HQ: Docker Cloud
 
Simple tools to fight bigger quality battle
Simple tools to fight bigger quality battleSimple tools to fight bigger quality battle
Simple tools to fight bigger quality battle
 
Cloud continuous integration- A distributed approach using distinct services
Cloud continuous integration- A distributed approach using distinct servicesCloud continuous integration- A distributed approach using distinct services
Cloud continuous integration- A distributed approach using distinct services
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Turnkey Continuous Delivery
Turnkey Continuous DeliveryTurnkey Continuous Delivery
Turnkey Continuous Delivery
 
Alexey Kupriyanenko "Release Early, Often, Stable"
Alexey Kupriyanenko "Release Early, Often, Stable"Alexey Kupriyanenko "Release Early, Often, Stable"
Alexey Kupriyanenko "Release Early, Often, Stable"
 

KĂŒrzlich hochgeladen

+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@
 
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
 

KĂŒrzlich hochgeladen (20)

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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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?
 
+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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Using Docker in CI process

  • 1. Introduction The pipeline The environment The images The problems Finish Using Docker in CI process Applied Docker G. Godlewski March 16, 2016
  • 2. Introduction The pipeline The environment The images The problems Finish Author About me Programming, karate, music and cheese making. Currently working for SMT Software Services
  • 3. Introduction The pipeline The environment The images The problems Finish The background Long time ago, in a galaxy far, far away...
  • 4. Introduction The pipeline The environment The images The problems Finish The background
  • 5. Introduction The pipeline The environment The images The problems Finish The background Scope of automation Unit tests Functional tests Integration tests Quality checks (nightly build, code coverage, phpmd, phpcs, jshint, jslint, ...) Deployments One should constantly search for spots where time could be saved
  • 6. Introduction The pipeline The environment The images The problems Finish DeïŹnitions Continuous Integration Martin Fowler: Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is veriïŹed by an automated build (including test) to detect integration errors as quickly as possible.
  • 7. Introduction The pipeline The environment The images The problems Finish DeïŹnitions Continuous Delivery Martin Fowler: A common question we hear is “what is the diïŹ€erence between Continuous Delivery and Continuous Deployment?” Both terms are similar and were coined around the same time. I see the diïŹ€erence as a business decision about frequency of deployment into production. Continuous Delivery is about keeping your application in a state where it is always able to deploy into production. Continuous Deployment is actually deploying every change into production, every day or more frequently.
  • 8. Introduction The pipeline The environment The images The problems Finish Product The point of view
  • 9. Introduction The pipeline The environment The images The problems Finish Process The process Building - parts put together, diagnostics and veriïŹcation, removal of unnecessary parts Packaging - a ready product is being put into a package (container) Delivery - the whole package is shipped to the client in a clearly deïŹned manner Each of the stages has a clear I/O deïŹnition
  • 10. Introduction The pipeline The environment The images The problems Finish Process Building up a complete solution In case of a product composed from several components (eg. complex system) we could use the analogy of buying kitchen furniture. All packages contain components that fulïŹll a deïŹned set of criteria We know how the components should be connected We know how the components should be placed within client’s infrastructure (kitchen) Don’t dismiss the power of analogy!
  • 11. Introduction The pipeline The environment The images The problems Finish Warming up! What will we use Docker for Performing CI builds within isolated containers (docker in docker, sic!) Providing the package for the product in which will it be further distributed Running our applications
  • 12. Introduction The pipeline The environment The images The problems Finish Warming up!
  • 13. Introduction The pipeline The environment The images The problems Finish Warming up! Getting ready 1 Ensure the right kernel version (starting from 3.10!) 2 Ensure you have all required kernel modules (aufs, devicemapper etc - depends on the distribution) 3 Latest docker-engine installed 4 Latest docker-compose installed
  • 14. Introduction The pipeline The environment The images The problems Finish Additional tools Ansible What for? Describe how the application should be delivered (deployment to server) ConïŹguration management Why? Great documentation Huge amount of modules - I didn’t have to build my own yet!
  • 15. Introduction The pipeline The environment The images The problems Finish Own Docker Hub Docker Hub hub: restart: always image: registry:2 ports: - "5000:5000" environment: TERM: linux REGISTRY_HTTP_TLS_CERTIFICATE: :) REGISTRY_HTTP_TLS_KEY: :) REGISTRY_AUTH: htpasswd REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm volumes: - "/home/docker-distro/registry/data:/var/lib/registry" - "/etc/ssl/certs:/certs" - "/etc/ssl/private:/keys" - "/home/docker-distro/registry/auth:/auth" Hint Keep security in mind!
  • 16. Introduction The pipeline The environment The images The problems Finish The CI Server TeamCity Free version provides: 3 build agents 20 build conïŹgurations Broad conïŹguration capabilities (build parameters, conïŹguration templates, deïŹning dependencies etc)
  • 17. Introduction The pipeline The environment The images The problems Finish Understanding CI Build Server and Build Agents
  • 18. Introduction The pipeline The environment The images The problems Finish Customs Special forces
  • 19. Introduction The pipeline The environment The images The problems Finish Customs Custom Agent FROM sjoerdmulder/teamcity-agent:latest MAINTAINER Grzegorz Godlewski <grzegorz@sorcerystudio.com> RUN apt-get -y install software-properties-common RUN apt-add-repository ppa:ansible/ansible RUN apt-get update RUN apt-get -y install ansible COPY ./keys/id_rsa /home/teamcity/.ssh/id_rsa RUN chown -R teamcity:teamcity /home/teamcity/.ssh ADD docker-entrypoint.sh /docker-entrypoint.sh RUN chmod a+x docker-entrypoint.sh
  • 20. Introduction The pipeline The environment The images The problems Finish Customs Extending the images
  • 21. Introduction The pipeline The environment The images The problems Finish Implementation TeamCity Server server: image: "sjoerdmulder/teamcity:latest" ports: - "8111:8111" volumes: - "/home/teamcity/server/data:/var/lib/teamcity" environment: TERM: linux
  • 22. Introduction The pipeline The environment The images The problems Finish Implementation TeamCity Agent agent: image: "my-own-hub/teamcity-agent:latest" ports: - "9090:9090" volumes: - "/var/run/docker.sock:/var/run/docker.sock" # docker in docker - "/usr/bin/docker:/usr/bin/docker" - "/usr/bin/docker:/usr/local/bin/docker" - "/home/teamcity/agent/work:/opt/buildAgent/work" # work directories - "/home/teamcity/agent/composer:/opt/composer/cache" # composer cache - "/home/teamcity/agent/docker:/home/teamcity/.docker" # hub auth keys environment: TERM: linux TEAMCITY_SERVER: "http://teamcity_server:8111" # your server TEAMCITY_AGENT_NAME: "Alpha" # readable name AGENT_HOME_ON_HOST: "/home/teamcity/agent" # custom ENV for runtime
  • 23. Introduction The pipeline The environment The images The problems Finish Implementation The ïŹ‚ow 1 Run build in dev image 2 Package using dist image 3 Distribute using Ansible and docker-compose
  • 24. Introduction The pipeline The environment The images The problems Finish It’s never that easy Not so easy... Cleaning up CI process performance Proper kernel modules Dynamically linked modules Race conditions
  • 25. Introduction The pipeline The environment The images The problems Finish It’s never that easy https://github.com/docker/docker/issues/4036
  • 26. Introduction The pipeline The environment The images The problems Finish It’s never that easy https://github.com/docker/docker/issues/4036 If you’re using the devicemapper diver, make sure that Udev Sync Supported is set to true.
  • 27. Introduction The pipeline The environment The images The problems Finish Questions?
  • 28. Introduction The pipeline The environment The images The problems Finish Thank you! http://linkedin.com/in/ggodlewski grzegorz@sorcerystudio.com @GGodlewski