Lesson 4.2

Building images in CI

A CI-built image is reproducible and traceable to a commit.

1hBeginner14.1k students

Overview

The pipeline builds it, not your laptop

A CI-built image is reproducible and traceable to a commit. Images built and pushed from a developer machine carry whatever happened to be in that working directory.

CI runners start clean, so the build cache is empty unless you bring it. Exporting the cache to the registry between runs is usually the difference between a one-minute build and a ten-minute one.

Multi-architecture builds matter now that developer machines and production hosts frequently differ. Building both platforms in the pipeline avoids the image that only runs on the machine that built it.

In this lesson you will:

  • Build and push from a pipeline
  • Reuse a build cache between runs
  • Build for more than one architecture

Resources

Previous Lesson
Next Lesson
Building images in CI — Docker Essentials — Vertex