Container images¶
image: <name>:<tag> resolves the tag to the digest of its manifest. For a
multi-arch image that is the digest of the index, so a new build for any
platform changes it.
scope:
source: ["compose.yaml", "**/*.go"]
resolve:
- image: postgres:16 # Docker Hub
- image: ghcr.io/acme/orders-db:nightly # any OCI registry
- A name without a host is a Docker Hub name:
postgres:16isdocker.io/library/postgres:16, and so aredocker.io/postgres:16andindex.docker.io/postgres:16. No tag meanslatest. - The digest Aval reads is the registry's, not the runner's. Compose without
pull_policy: always, or Kubernetes withIfNotPresent, can run a copy pulled earlier: pull before the test, or pin by digest. - Also covers what the scanner cannot see,
such as Helm values that split
repositoryandtag: declare the image those values make. -
An image test code starts through testcontainers is declared the same way. The scanner reports the literal; resolving the tag puts its digest in the fingerprint:
-
Credentials come from
docker login($DOCKER_CONFIG). A loopback registry (localhost:5000) is reached over plain HTTP.
scope.resolve never clears a scanner finding: a move
changes the fingerprint, but the reference still blocks reuse. Pin it in
place, or accept it with
scope.allowMutable.
Pin instead when you want what you run to be exactly what you hashed:
image: postgres:16@sha256:<digest> in the file. Find the digest with
crane digest postgres:16.