A rebuild five seconds later#
This fixture builds one commit in a CI step, then lets a release job either rebuild it or promote the tested digest (Docker 29.1.3, local registry:2). The Dockerfile records the build time, as many builds do through a version banner or a generated file:
## CI job: build commit 3f9c2e1 and push sha-3f9c2e1 (tests run on this digest)
tested: sha256:9a31f954eacccae13efbe19d0c10fc75bf8f3ba9f8aebf751f484a561fc7940b
## release job, option 1: rebuild the same commit and push 1.4.0
rebuilt: sha256:6df711f4fe119dcc432601024612c3318e78f2b767d26ffabf0ae04f720457de
## release job, option 2: promote the tested digest to 1.4.1
promoted: sha256:9a31f954eacccae13efbe19d0c10fc75bf8f3ba9f8aebf751f484a561fc7940b
## what differs inside
sha-3f9c2e1 build-time: 2026-12-02T07:38:46Z
1.4.0 build-time: 2026-12-02T07:38:51Z
The rebuild succeeded and was pushed under a release tag, and nothing reported that its digest differs from the tested one. Here the difference is a timestamp. In another build it could be a dependency that resolved to a newer version or a base image tag that moved, and the digest alone does not say which. Two builds with different checksums covers finding out.
Promote without changing the digest#
The fixture promoted by pulling the tested image by digest, tagging it and pushing. Docker documents pulling by digest as the way to get a fixed image that a later push cannot change. Pull an image by digest
docker buildx imagetools create copies inside the registry, but it can change the digest. Its reference says that a single source that is a manifest list or index gets "a carbon copy", while a single-platform manifest becomes a new manifest list unless you pass --prefer-index=false. imagetools create Whichever tool you use, read the digest after the push and compare it with the tested one.
For files such as archives and binaries, promotion means copying the tested file and its recorded checksum:
sha256sum -c tested.sha256
Make sure the file the tests ran on is the one you copy. If the test job built its own copy and the packaging job built another, there was never one tested artifact to promote. Artifacts from another run covers the download side.
Decide#
| Release artifact | Did the tests run on these bytes? |
|---|---|
| Same digest or checksum as the tested artifact | Yes |
| Rebuilt, checksum equal to the tested one | Yes, by content: the build reproduced the same bytes |
| Rebuilt, checksum different | No. Test it, or promote the tested one |
| Built with release-only settings, such as other flags | No. It is a new artifact and needs its own tests |
A rebuild is reasonable when the release must differ, for example when a release build sets optimization or feature flags that the test build lacked. Then the tests belong in the release pipeline, run against that artifact.
Worked example#
This example is fictional. Ana's pipeline tests app:sha-3f9c2e1, then a release job rebuilds and pushes app:1.4.0. After a rollback, Ben compares the tested digest from the CI log with the digest the cluster ran and finds two different values. The difference turns out to be a minor version of a logging library that a version range admitted between the two builds. The pipeline now promotes the tested digest and fails if the digest after the push differs.
For the running side, read which image digest is running.