grafclouds.com / documents / training / devops-challenges / docker-cache-bust-rebuild

The Build Is Slow, So Let's Just Add --no-cache to CI?

Beginner ~9 min read
DockerCI/CD

Scenario

Docker builds in CI have crept from 3 minutes to 11 over the past months. Worse, a recent release shipped with old dependencies even though the team was sure they had been updated — a stale-cache incident that burned everyone's trust in the build. The Dockerfile copies the whole working directory before installing dependencies, and the base image is referenced by a floating tag rather than a pinned digest.

The Quick Fix on the Table

A colleague proposes adding --no-cache to every CI build. No cache means no stale layers, no "is it the cache?" debugging sessions, and every image guaranteed fresh. One flag, and the whole class of problem disappears.

Interview · Round 1

The quick fix is on the table and the room is waiting for your call. Would you sign off on it? Take a position and justify it — out loud or on paper — before revealing the analysis.