Chapter 7. Continuous delivery: a perfect fit for Docker principles

 

This chapter covers

  • The Docker contract between dev and ops
  • Taking manual control of build availability across environments
  • Moving builds between environments over low-bandwidth connections
  • Centrally configuring all containers in an environment
  • Achieving zero-downtime deployment with Docker

Once you’re confident that all of your builds are being quality-checked with a consistent CI process, the logical next step is to start looking at deploying every good build to your users. This goal is known as continuous delivery (CD).

In this chapter we’ll refer to your CD pipeline—the process your build goes through after it comes out of your CI pipeline. The separation can sometimes be blurred, but think of the CD pipeline as starting when you have a final image that has passed your initial tests during the build process. Figure 7.1 demonstrates how the image might progress through a CD pipeline until it (hopefully) reaches production.

Figure 7.1. A typical CD pipeline

It’s worth repeating that last point—the image that comes out of CI should be final and unmodified throughout your CD process! Docker makes this easy to enforce with immutable images and encapsulation of state, so using Docker takes you one step down the CD road already.

7.1. Interacting with other teams during the CD pipeline

First we’re going to take a little step back and look at how Docker changes the relationship between development and operations.

Technique 62 The Docker contract—reducing friction

7.2. Facilitating deployment of Docker images

Technique 63 Manually mirroring registry images

Technique 64 Delivering images over constrained connections

Technique 65 Sharing Docker objects as TAR files

7.3. Configuring your images for environments

Technique 66 Informing your containers with etcd

7.4. Upgrading running containers

Technique 67 Using confd to enable zero-downtime switchover

7.5. Summary