Core Concept 1: The "Locked Box" (Why We Must Use Docker)
Why using a custom Docker image as a Locked Box is the cornerstone of a reliable, portable, and fast CI/CD pipeline.
1. Reliability
The ubuntu-latest agent is "floating" — Microsoft updates it constantly. A custom Dockerfile creates a locked, immutable environment. No more "it broke on Monday" bugs.
2. Portability
Developers can run docker build locally — eliminates "it works on my machine".
3. Speed
Pre-baking tools into the image means they are instantly available on every job — no apt-get time wasted.