Reading build progress and diagnosing cache misses
A small example
FROM busybox:1.37RUN echo preparing > /status.txtRUN test -s /status.txtCMD ["cat", "/status.txt"]Use --progress=plain to read the steps without an updating terminal display. Look for cached versus executed operations and the first failing operation. Status spelling and numbering are not stable test contracts. The second RUN checks that the file is nonempty; it is a tiny build assertion, not a full application test. A successful export does not prove container startup, so the runtime command verifies one separate property. Treat a failed build as a failed gate even if an old tag still runs. Plain progress may include output from build commands; keep confidential inputs out of the lab and redact private endpoints before sharing.
Try it in a local lab
Manual lab, not a ByteMind executable exercise. Use a new approved disposable Linux VM with blocked network egress and a local Engine and Buildx docker driver. Check docker context show, docker version, docker buildx version and docker buildx ls before doing anything. Confirm the reviewed, preloaded busybox:1.37 for the native platform, expected default user, no entrypoint, required applets and bundled frontend support for RUN mounts. Record its actual digest and versions. If a dependency needs to be fetched or the builder is remote, stop. --network none restricts RUN networking, not all builder traffic. Confirm all bm-v09 tags are unused. Run commands individually in the named fixture directory, stopping on any unexpected failure. All values are synthetic; do not use real credentials. Expected results are predictions, not observed output. Before querying or building, confirm DOCKER_HOST, DOCKER_CONTEXT and BUILDX_BUILDER overrides and the effective endpoint are approved; do not contact an unapproved endpoint. docker build normally uses the Engine default builder, not necessarily the starred Buildx builder. Record the effective local docker driver and platform; review the synthetic context and ignore rules. After each build, require exit status zero before running its tag; an earlier tag may still exist after failure.
Open lab-fixtures/docker-builds-and-caching/05-progress/ in the extracted archive. The Dockerfile and these files are supplied. Work on a disposable copy, not the original archive.
docker build --load --network none --progress=plain -t bm-v09-progress:lab .docker run --rm --pull=never --network none bm-v09-progress:labdocker build --load --network none --progress=plain -t bm-v09-progress:lab .docker build --load --network none --no-cache --progress=plain -t bm-v09-progress:lab .docker run --rm --pull=never --network none bm-v09-progress:labBoth successful builds should produce an image whose container prints preparing. The unchanged build may report reused steps; the --no-cache build should re-execute the ordinary RUN steps. Do not compare invented durations.
Confirm the tag belongs to this lab and no containers depend on it. Remove only that tag without forcing. Cached data may remain; dispose of the VM rather than clearing a shared cache. Restore any edited fixture or discard the working copy.
Common mistake
Never publish raw build logs containing sensitive data. A cache hit can skip a command entirely, so absence of its log line is not proof that the command failed.
Manual practice
On paper, change the test to check a missing file. Identify where failure should occur and explain why a previously tagged image may still exist after a failed rebuild.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Reading build progress and diagnosing cache misses — Knowledge check
Apply the build concept to a new scenario.
Which flag requests plain output?
What proves this fixture prints preparing?
Where should diagnosis begin?