際際滷

際際滷Share a Scribd company logo
CI with Docker-in-Docker
Mukta Aphale
@muktaa mukta@velotio.com
AGENDA
 Recap: CI, Jenkins
 Jenkins + Docker
 Docker in Docker problems
 3 ways to solve docker-in-docker
 Jenkins with Docker-in-Docker: Simplest way
 Advantages of dind in CI pipeline
 VP Devops & Cloud, Velotio Technologies
 (We are hiring!!) => mukta@velotio.com
 Developer for 1 decade and in Devops for another decade!
 (Probably successful) Entrepreneur
 Love to solve problems creatively
 Love to travel, cook, paint, explore and meet people
 Mother to two (handsome) boys!
@muktaa mukta@velotio.com
Run everything inside Docker containers. Even Docker itself!
Quick Recap
 Docker Runtime
 Continuous Integration
 Jenkins
 Jenkins in Docker
This is the problem:
Building container apps on Jenkins which is
running as a container
Docker in Docker Problems
 When starting a container, the inner Docker
might try to apply security profiles that will
conflict or confuse the outer Docker.
 When you run Docker in Docker, the outer
Docker runs on top of a normal filesystem but
the inner Docker runs on top of a
copy-on-write system
 Handling build cache: if your CI system does
builds and rebuilds, each time youll restart
your Docker-in-Docker container, you might
be nuking its cache
And then there was light
They didnt know it was impossible, so they did it. - Mark Twain
 Sysbox
 Container runtime, based on runc,
 Enables to run Docker-in-Docker securely and easily, integrating with existing CI tools
seamlessly
 https://github.com/nestybox/sysbox
 Socket Solution
 Run docker with the default Unix socket docker.sock as a volume
 docker run -v /var/run/docker.sock:/var/run/docker.sock -ti docker
 Security Risks
 Dind
 Use official Docker image with dind tag: docker run --privileged -d --name dind-test docker:dind
 Outer container runs in privileged mode
Using disposable containers in CI
https://stefanprodan.com/2016/continuous-integration-with-jenkins-and-disposable-containers/
Jenkins Pipeline with Docker
Jenkins Master
Docker Plugin
Docker Host, API
Docker Image
Configure Docker &
Agent (Jenkins ->
Config -> Cloud ->
Docker)
Jenkins Job
https://narenchejara.medium.com/how-to-configure-docker-container-as-build-slaves-for-jenkins-d7795f78402d
Jenkins Setup with Docker-in-Docker
1. Run Jenkins in container using official image (docker:dind)
a. Customized image: https://github.com/4OH4/jenkins-docker
2. Or, Clone repo and build image
docker run -it -p 8080:8080 -p 50000:50000 
-v jenkins_home:/var/jenkins_home 
-v /var/run/docker.sock:/var/run/docker.sock 
--restart unless-stopped 
4oh4/jenkins-docker
docker build -t jenkins-docker .
docker run -it -p 8080:8080 -p 50000:50000 
-v jenkins_home:/var/jenkins_home 
-v /var/run/docker.sock:/var/run/docker.sock 
--restart unless-stopped 
4oh4/jenkins-docker
Advantages of using Docker-in-Docker in CI
 On demand build environments
 No need for dedicated VMs
 Useful for microservices which are written in different languages
 Cost effective
 Better automation of continuous testing
 Very useful for performance testing
References
https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
https://medium.com/swlh/quickstart-ci-with-jenkins-and-docker-in-docker-c3f7174e
e9ff
https://itnext.io/docker-in-docker-521958d34efd
https://stefanprodan.com/2016/continuous-integration-with-jenkins-and-disposable
-containers/
Thank You!

More Related Content

Similar to CI with Docker in Docker (20)

Introducing docker
Introducing dockerIntroducing docker
Introducing docker
Bill Wang
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
Amr Fawzy
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
BADR
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
Giacomo Vacca
Containerization using docker
Containerization using dockerContainerization using docker
Containerization using docker
Vinod Doshi
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
Dockercon 23 - Getting started with Docker
Dockercon 23 - Getting started with DockerDockercon 23 - Getting started with Docker
Dockercon 23 - Getting started with Docker
ssuserfb6acb
Docker 101 describing basic docker usage
Docker 101 describing basic docker usageDocker 101 describing basic docker usage
Docker 101 describing basic docker usage
ZiyanMaraikar1
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
InfluxData
Data Science Workflows using Docker Containers
Data Science Workflows using Docker ContainersData Science Workflows using Docker Containers
Data Science Workflows using Docker Containers
Aly Sivji
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
Giacomo Vacca
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Frank Munz
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
Frank Munz
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
GDSC UofT Mississauga
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker compose
Lalatendu Mohanty
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
Samuel Chow
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, CloudbeesReduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Docker, Inc.
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
James Turnbull
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
Jordan Open Source Association
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
Ahmed Sorour
Introducing docker
Introducing dockerIntroducing docker
Introducing docker
Bill Wang
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
Amr Fawzy
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
BADR
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
Giacomo Vacca
Containerization using docker
Containerization using dockerContainerization using docker
Containerization using docker
Vinod Doshi
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
Dockercon 23 - Getting started with Docker
Dockercon 23 - Getting started with DockerDockercon 23 - Getting started with Docker
Dockercon 23 - Getting started with Docker
ssuserfb6acb
Docker 101 describing basic docker usage
Docker 101 describing basic docker usageDocker 101 describing basic docker usage
Docker 101 describing basic docker usage
ZiyanMaraikar1
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
InfluxData
Data Science Workflows using Docker Containers
Data Science Workflows using Docker ContainersData Science Workflows using Docker Containers
Data Science Workflows using Docker Containers
Aly Sivji
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
Giacomo Vacca
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Frank Munz
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
Frank Munz
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker compose
Lalatendu Mohanty
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
Samuel Chow
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, CloudbeesReduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Reduce DevOps Friction with Docker & Jenkins by Andy Pemberton, Cloudbees
Docker, Inc.
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
James Turnbull
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
Ahmed Sorour

More from Mukta Aphale (10)

Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
Mukta Aphale
Baking Docker Using Chef
Baking Docker Using ChefBaking Docker Using Chef
Baking Docker Using Chef
Mukta Aphale
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?
Mukta Aphale
Application Monitoring using Datadog
Application Monitoring using DatadogApplication Monitoring using Datadog
Application Monitoring using Datadog
Mukta Aphale
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
Mukta Aphale
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
Mukta Aphale
MomOps in DevOps
MomOps in DevOpsMomOps in DevOps
MomOps in DevOps
Mukta Aphale
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
Mukta Aphale
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
Mukta Aphale
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
Mukta Aphale
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
Mukta Aphale
Baking Docker Using Chef
Baking Docker Using ChefBaking Docker Using Chef
Baking Docker Using Chef
Mukta Aphale
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?
Mukta Aphale
Application Monitoring using Datadog
Application Monitoring using DatadogApplication Monitoring using Datadog
Application Monitoring using Datadog
Mukta Aphale
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
Mukta Aphale
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
Mukta Aphale
MomOps in DevOps
MomOps in DevOpsMomOps in DevOps
MomOps in DevOps
Mukta Aphale
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
Mukta Aphale
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
Mukta Aphale
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
Mukta Aphale

Recently uploaded (20)

What Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI AgentsWhat Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI Agents
Zilliz
Deno ...................................
Deno ...................................Deno ...................................
Deno ...................................
Robert MacLean
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
ScyllaDB
Wondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 LatestWondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 Latest
udkg888
DevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdfDevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdf
Justin Reock
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
Safe Software
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
Endpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore ItEndpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore It
MSP360
Build with AI on Google Cloud Session #4
Build with AI on Google Cloud Session #4Build with AI on Google Cloud Session #4
Build with AI on Google Cloud Session #4
Margaret Maynard-Reid
Computational Photography: How Technology is Changing Way We Capture the World
Computational Photography: How Technology is Changing Way We Capture the WorldComputational Photography: How Technology is Changing Way We Capture the World
Computational Photography: How Technology is Changing Way We Capture the World
HusseinMalikMammadli
DealBook of Ukraine: 2025 edition | AVentures Capital
DealBook of Ukraine: 2025 edition | AVentures CapitalDealBook of Ukraine: 2025 edition | AVentures Capital
DealBook of Ukraine: 2025 edition | AVentures Capital
Yevgen Sysoyev
Transform Your Future with Front-End Development Training
Transform Your Future with Front-End Development TrainingTransform Your Future with Front-End Development Training
Transform Your Future with Front-End Development Training
Vtechlabs
UiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilitiesUiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilities
DianaGray10
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1
DianaGray10
Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)
nick896721
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Precisely
Cloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in AviationCloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in Aviation
Assem mousa
Gojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptxGojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptx
V3cube
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOTSMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
TanmaiArni
What Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI AgentsWhat Makes "Deep Research"? A Dive into AI Agents
What Makes "Deep Research"? A Dive into AI Agents
Zilliz
Deno ...................................
Deno ...................................Deno ...................................
Deno ...................................
Robert MacLean
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
How Discord Indexes Trillions of Messages: Scaling Search Infrastructure by V...
ScyllaDB
Wondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 LatestWondershare Filmora Crack 14.3.2.11147 Latest
Wondershare Filmora Crack 14.3.2.11147 Latest
udkg888
DevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdfDevNexus - Building 10x Development Organizations.pdf
DevNexus - Building 10x Development Organizations.pdf
Justin Reock
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
[Webinar] Scaling Made Simple: Getting Started with No-Code Web Apps
Safe Software
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
Endpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore ItEndpoint Backup: 3 Reasons MSPs Ignore It
Endpoint Backup: 3 Reasons MSPs Ignore It
MSP360
Build with AI on Google Cloud Session #4
Build with AI on Google Cloud Session #4Build with AI on Google Cloud Session #4
Build with AI on Google Cloud Session #4
Margaret Maynard-Reid
Computational Photography: How Technology is Changing Way We Capture the World
Computational Photography: How Technology is Changing Way We Capture the WorldComputational Photography: How Technology is Changing Way We Capture the World
Computational Photography: How Technology is Changing Way We Capture the World
HusseinMalikMammadli
DealBook of Ukraine: 2025 edition | AVentures Capital
DealBook of Ukraine: 2025 edition | AVentures CapitalDealBook of Ukraine: 2025 edition | AVentures Capital
DealBook of Ukraine: 2025 edition | AVentures Capital
Yevgen Sysoyev
Transform Your Future with Front-End Development Training
Transform Your Future with Front-End Development TrainingTransform Your Future with Front-End Development Training
Transform Your Future with Front-End Development Training
Vtechlabs
UiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilitiesUiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilities
DianaGray10
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1
DianaGray10
Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)
nick896721
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Stronger Together: Combining Data Quality and Governance for Confident AI & A...
Precisely
Cloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in AviationCloud of everything Tech of the 21 century in Aviation
Cloud of everything Tech of the 21 century in Aviation
Assem mousa
Gojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptxGojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptx
V3cube
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOTSMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
TanmaiArni

CI with Docker in Docker

  • 1. CI with Docker-in-Docker Mukta Aphale @muktaa mukta@velotio.com
  • 2. AGENDA Recap: CI, Jenkins Jenkins + Docker Docker in Docker problems 3 ways to solve docker-in-docker Jenkins with Docker-in-Docker: Simplest way Advantages of dind in CI pipeline VP Devops & Cloud, Velotio Technologies (We are hiring!!) => mukta@velotio.com Developer for 1 decade and in Devops for another decade! (Probably successful) Entrepreneur Love to solve problems creatively Love to travel, cook, paint, explore and meet people Mother to two (handsome) boys! @muktaa mukta@velotio.com
  • 3. Run everything inside Docker containers. Even Docker itself!
  • 4. Quick Recap Docker Runtime Continuous Integration Jenkins Jenkins in Docker
  • 5. This is the problem: Building container apps on Jenkins which is running as a container Docker in Docker Problems When starting a container, the inner Docker might try to apply security profiles that will conflict or confuse the outer Docker. When you run Docker in Docker, the outer Docker runs on top of a normal filesystem but the inner Docker runs on top of a copy-on-write system Handling build cache: if your CI system does builds and rebuilds, each time youll restart your Docker-in-Docker container, you might be nuking its cache
  • 6. And then there was light They didnt know it was impossible, so they did it. - Mark Twain Sysbox Container runtime, based on runc, Enables to run Docker-in-Docker securely and easily, integrating with existing CI tools seamlessly https://github.com/nestybox/sysbox Socket Solution Run docker with the default Unix socket docker.sock as a volume docker run -v /var/run/docker.sock:/var/run/docker.sock -ti docker Security Risks Dind Use official Docker image with dind tag: docker run --privileged -d --name dind-test docker:dind Outer container runs in privileged mode
  • 7. Using disposable containers in CI https://stefanprodan.com/2016/continuous-integration-with-jenkins-and-disposable-containers/
  • 8. Jenkins Pipeline with Docker Jenkins Master Docker Plugin Docker Host, API Docker Image Configure Docker & Agent (Jenkins -> Config -> Cloud -> Docker) Jenkins Job https://narenchejara.medium.com/how-to-configure-docker-container-as-build-slaves-for-jenkins-d7795f78402d
  • 9. Jenkins Setup with Docker-in-Docker 1. Run Jenkins in container using official image (docker:dind) a. Customized image: https://github.com/4OH4/jenkins-docker 2. Or, Clone repo and build image docker run -it -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped 4oh4/jenkins-docker docker build -t jenkins-docker . docker run -it -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped 4oh4/jenkins-docker
  • 10. Advantages of using Docker-in-Docker in CI On demand build environments No need for dedicated VMs Useful for microservices which are written in different languages Cost effective Better automation of continuous testing Very useful for performance testing