With the rise of DevOps, continuous integration tools came to prominence. The leading CI tool, of course, is Jenkins....
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
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.
These are the actions your CI tool takes, in order:
- Builds the Docker image from your repository
- Tests the Docker image against your test suite
- Pushes the Docker image to Docker Hub or a private registry
- 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:
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.
What are the benefits of containers with Docker?
The drawbacks of Docker instances
Is your CI process working?
Related Q&A from Twain Taylor
The introduction of containers can certainly complicate governance, especially when working with microservices. Here's how a containers-as-a-service ...continue reading
Although Android and iOS rule mobile OSes, within these OSes are multiple versions. Because of this, when developing for mobile platforms, you face a...continue reading
Learn how Kubernetes container orchestration can be leveraged by organizations to provide the service registry governance needed to support a ...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.