Using Docker to power a CI/CD pipeline

The goal of this section is to build a CI/CD pipeline that looks like this:

A simple CI/CD pipeline using Jenkins

We are going to use Jenkins (https://jenkins.io) as our automation server. Other automation servers such as TeamCity (https://www.jetbrains.com/teamcity) work equally well. When using Jenkins, the central document is the Jenkinsfile, which will contain the definition of the pipeline with its multiple stages.

A simple Jenkinsfile with the Build, Test, Deploy to Staging, and Deploy to Production stages could look like this:

pipeline {    agent any    options {        skipStagesAfterUnstable()    } stages { ...

Get Learn Docker - Fundamentals of Docker 19.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.