Review a Container Build Before Release
Separate image identity, build inputs and runtime validation using a small release-review exercise.
Before you start: Recognize a Dockerfile and a container image
The scenario
A fictional report service worked yesterday. Today the same Dockerfile produces a different result because a referenced base-image tag changed. The team proposes keeping the old build cache forever. Instead, document the build inputs and test the release artifact deliberately.
1. List the inputs
Record the source revision, base image reference, dependency lockfiles, target platform and build arguments. A tag is a convenient name that can point to a different image later. A digest identifies an image, but pinning it still requires an update process to adopt fixes. For this exercise, prepare a release record with separate fields for the human-readable tag and resolved digest.
2. Reduce accidental build context
Review what files the build can access. A .dockerignore file can exclude irrelevant local material from the context. Do not treat deleting a credential in a later image layer as a reliable way to remove it from an earlier layer. Keep secrets out of source, ordinary build arguments and recorded logs; use the build system’s documented secret mechanism where needed.
3. Separate building from running
Use a multi-stage build when the application needs compilers or other build-only tools that the final image does not need. Draw two boxes: build inputs and runtime requirements. Copy only the intended artifacts across that boundary. A smaller image is not automatically correct: missing certificates, libraries or configuration can still break the actual workflow.
4. Test the artifact you will deploy
In a disposable environment, run the built image with representative non-sensitive configuration. Test startup, an application request, shutdown and a failure path. Record the tested digest so a deployment can select that artifact. A successful build log is evidence about the build, not proof of runtime health, compatibility or a working rollback.
Try two more cases
Practice with EmuPath
Check the primary reference
Examples are educational scenarios. Verify the current documentation and your own environment before changing a real system.