Container CI/CD pipelines automate the entire lifecycle of containerized applications—from building images to deploying them across environments—while embedding security, testing, and quality gates at every step. These pipelines are the backbone of modern cloud-native development, enabling teams to ship updates rapidly without sacrificing reliability or security. A well-designed pipeline integrates build optimization, vulnerability scanning, image promotion, and GitOps workflows to create a seamless path from source code to production. The key distinction from traditional CI/CD lies in the immutable, portable nature of containers: you build once, test thoroughly, and deploy the same artifact everywhere, ensuring consistency across environments while minimizing configuration drift. In 2026, supply chain security—SBOM attestations, provenance verification, and pipeline hardening—has become as central to pipeline design as build speed and deployment frequency.
What This Cheat Sheet Covers
This topic spans 16 focused tables and 178 indexed concepts, 120 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Container Build Strategies
Multi-stage builds and intelligent layer ordering are the foundation of fast, small container images. Choosing the right build strategy up front determines both your image size and how quickly CI rebuilds run on incremental code changes.
| Strategy | Example | Description | |
|---|---|---|---|
FROM golang:1.21 AS builderWORKDIR /appCOPY . .RUN go build -o appFROM alpine:3.19COPY --from=builder /app/app . | • Separates build environment from runtime • drastically reduces final image size by copying only compiled artifacts into a minimal base. | ||
COPY package*.json ./RUN npm installCOPY . . | • Orders Dockerfile instructions from least to most frequently changing • placing dependency installation before source code maximizes cache reuse across rebuilds. | ||
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt | • Persists package-manager caches across builds without baking them into layers • 10x faster dependency installs on warm CI runners. | ||
.dockerignore:node_modules*.log.git | • Excludes unnecessary files from build context with .dockerignore• reduces context upload size and daemon transfer time. | ||
docker buildx build --platform linux/amd64,linux/arm64 -t myapp:latest . | • Creates multi-architecture images via QEMU emulation or native builders • supports both x86_64 and ARM64 from a single pipeline run. | ||
docker buildx build --cache-from=type=registry,ref=myrepo/cache--cache-to=type=registry,ref=myrepo/cache . | • Shares layer cache between CI runners via registry backend • enables persistent caching across ephemeral CI workers. | ||
docker buildx bake using docker-bake.hcl | • Declarative HCL/JSON file defining multiple build targets, groups, and matrices • replaces long docker build command strings with version-controlled config. | ||
RUN --mount=type=ssh git clone [email protected]:org/private-repo.git | • Forwards SSH agent socket into build without copying keys into image layers • secure way to clone private repositories during CI builds. | ||
FROM base AS depsFROM base AS testFROM deps AS prod | • BuildKit automatically runs independent stages concurrently • reduces total build time proportionally to stage parallelism. | ||
COPY go.mod go.sum ./RUN go mod downloadCOPY . .RUN go build | • Copies dependency manifests first to cache the download step separately • avoids re-downloading dependencies when only application code changes. | ||
Buildah, Kaniko, or BuildKit rootless mode | • Builds images without privileged daemon access or Docker socket • essential security control in shared CI environments. | ||
docker build --build-arg BUILDKIT_INLINE_CACHE=1 . | • Embeds cache metadata directly into image layers for --cache-from reuse• simpler than separate cache manifests but increases image size slightly. |