What are the benefits of integrating a CI tool with Docker?

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Source:- techtarget.com

With the rise of DevOps, continuous integration tools came to prominence. The leading CI tool, of course, is Jenkins. But there are other capable ones like CircleCI and GitLab CI. Let’s look at why you would want to integrate Docker with one of these CI tools and how you can get started with the integration.

Why integrate Docker with your CI tool?

DevOps is about moving to continuous integration and continuous delivery (CD). This means every step of the software lifecycle should be programmatic, repeatable and automated. This is not possible if your dev, quality assurance and ops teams work in silos. They need to be integrated using a common platform — a CI tool and a common way to package applications — like Docker.

Once integrated, you can use the same containers consistently across dev, test and production and avoid the annoying “works on my machine” syndrome.

It’s easy to get started with CI process, but extending it to CD isn’t as easy. If you plan on graduating from CI to CD, you need to integrate Docker with your CI tool.

What happens when you integrate them?

Here’s a flow of what happens when your CI tool and Docker work together across your development pipeline.

CI tools

These are the actions your CI tool takes, in order:

  1. Builds the Docker image from your repository
  2. Tests the Docker image against your test suite
  3. Pushes the Docker image to Docker Hub or a private registry
  4. Deploys the image to a cloud host

As you can see, integrating Docker with your CI tool benefits your entire development pipeline from development to production.

How to integrate Docker with CI tools

Jenkins uses a bunch of plug-ins to integrate with Docker. Here’s the list of plug-ins:

  • Jenkins Cloud Plugin for Docker
  • CloudBees Docker Traceability
  • CloudBees Docker Hub Notification
  • CloudBees Docker Build and Publish
  • CloudBees Docker Pipeline

Each of these plug-ins serves a different purpose across the pipeline.

CircleCI doesn’t use plug-ins, instead it requires you to work with a circle.yml file. You’ll need to make Docker a required service in your circle.yml file by adding the following text to it:

machine:
services:
– docker

Once enabled, you can use Docker commands throughout your circle.yml file. This includes commands like docker build, docker pull and docker push. The commands will be automatically triggered based on events that your CI tool watches for.

Integrating Docker and your CI tool is a vital step in your move to DevOps. It brings consistency and the power of automation across your pipeline. We looked at how to get setup with two popular CI tools — Jenkins and CircleCI. You can find similar how-to information for other CI tools as well. Build apps the DevOps way by integrating Docker and your CI tool today.

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x