Docker in the Pipeline

Where Docker Fits in This Book's DevOps Pipeline

From this chapter on, the thing that gets tested, stored and deployed is no longer a folder of source files but an image with a tag and a content digest, and that image ties the later chapters together.

The BookNest image at the center of the pipeline
The BookNest image at the center of the pipeline

Docker 514 's own workflow has not changed in spirit since 2013, and this chapter follows it with BookNest:

  1. Install Docker on each machine that builds or runs containers (Installing Docker Engine and Desktop, Engine, Rootless).

  2. Pull the images you depend on, such as postgres:18, and run them (First Containers).

  3. Connect the containers on a user-defined network (Docker Networking).

  4. Write your application; BookNest already exists.

  5. Write a Dockerfile and build your image (BookNest Dockerfile to Buildx and Multi-Platform).

  6. Push the image to a registry (Image Registries).

  7. Describe the stack in a Compose 514 file on the target machine (Docker Compose V2 Fundamentals to Containerizing BookNest).

  8. Run docker compose up, which pulls every image and starts every container.

The last step used to be docker-compose -f my-software.yaml up with the Python-based Compose v1, which reached end of life in 2023. Compose is now a Go plugin of the Docker CLI (v5.5.1 here) that reads compose.yaml by default. Jenkins's Jenkins 8,793 pipeline builds BookNest's Dockerfile unchanged, and Kubernetes deploys the resulting image to Kubernetes 5,150 .