An image with the latest tag, or with no tag at all (which means latest), can point at a different build each time it is pulled. Two machines can run different code from the same compose file, and an upgrade can arrive unannounced. The explainer flags this as low. Pin a version tag, or a sha256 digest for an exact, unchangeable image.
openrouting — compose explainer
$ explain docker-compose.yml! web uses an unpinned image tag lowline 3fix: see below$
What the free Docker Compose explainer reports on the risky example below.
Why it matters
`latest` is just a default tag name. It is moved by whoever publishes the image and does not promise compatibility, or even that it is the newest version.
Compose pulls an image when it is missing locally or when you run `docker compose pull`. A new server, a cleared cache or a routine pull can therefore bring a different version than the one you tested.
If a publisher's account or pipeline is compromised, an unpinned tag picks up the replaced image on the next pull. A digest cannot be moved to new content.
Replace latest or the missing tag with a specific version, e.g. nginx:1.27.2.
For an exact image, pin the digest: nginx:1.27.2@sha256:…, using the digest shown by docker images --digests or the registry.
Update pins on purpose, with a dependency update tool or a scheduled review, so upgrades are visible in your history.
When it's acceptable
Throwaway local experiments where you want whatever is newest and do not care about reproducing the result.
Check your own docker-compose.yml
The risky example is loaded below. Paste your own file to check it for this and every other Docker Compose rule. It runs in your browser; nothing is uploaded.
Limits memory to 512m. The container is killed if it exceeds this.
Questions
Does image: nginx without a tag use latest?
Yes. A missing tag means latest, so the explainer flags it the same way as an explicit :latest.
Is a version tag enough, or do I need a digest?
A version tag can still be re-pushed by the publisher. A sha256 digest always refers to the same image, so it is the stronger pin; many teams combine both for readability.
Does the explainer check services that use build instead of image?
No. It checks the image key only. Base images in a Dockerfile are checked by the Dockerfile explainer.