Sitemap

Member-only story

Using Jenkins to setup CI/CD for your docker build in 5 minutes

How to setup jenkins with docker-in-docker to build your docker based projects

4 min readDec 28, 2020
Press enter or click to view image in full size
Jenkins Logo (jenkins.io)

In this article, I’m going to describe how to use jenkins docker image to quickly setup a CI/CD pipeline for your small scale projects which are distributed as docker images. Follow this article if,

  • Your project is distributed/built as docker image(s) — Has associated Dockerfiles
  • Your project is small — small team / small code base like a pet project, startup
  • You are in need of setting up CI/CD without a lot of complexity like setting up jenkins agents
  • If setting up a jenkins cloud with docker or docker build agent is too much effort

Simply with this approach, you can get a CI/CD pipeline up and running for your project that is published as a docker image in 5 minutes.

TLDR;

Just run jenkins with docker installed in it using the following docker image. You need docker installed on your host machine.

docker run \
--publish 8000:8080 \
--publish 50000:50000 \
--volume jenkins_home:/var/jenkins_home \
Imesha Sudasingha
Imesha Sudasingha

Written by Imesha Sudasingha

Co-Founder @HighFlyer | Ex @WSO2 | Ex @BallerinaLang | Opensource | Member @TheASF