Recently I lost a good chunk of a day chasing an issue in our OWASP Dependency-Track container setup. The strange part: the problem had nothing to do with Dependency-Track itself. It was how I had configured it.
What went wrong
I had pinned our docker-compose.yml to a snapshot tag, something like dependencytrack/apiserver:4-snapshot. In my head, a tag like that behaves like a version number: you pull it once, it stays what it is, and you move on.
That assumption is wrong.
Snapshot tags on Docker Hub are not static. They get overwritten every time a new build lands upstream. The 4-snapshot and 5-snapshot tags on the dependencytrack/apiserver and dependencytrack/frontend repositories are pushed regularly, sometimes daily. So the image I "pinned" last month is not the image I got today, even though the tag in my compose file never changed.
Remark: The Dependency-Track docs are actually explicit about this: the latest tag always points to the latest stable GA release, and snapshot builds are meant for testing unreleased changes, not for anything you want to stay put.
Why this bit me
A docker compose pull or a container restart on a node that hadn't cached the image yet was enough to silently swap in a newer snapshot build. No changelog in my workflow, no warning, just different behavior than the day before. Debugging that is miserable, because everything about my configuration looked unchanged. The image underneath had simply moved.
The fix
Two options, depending on what you actually need:
- Pin to a real release tag. If you don't need bleeding-edge features, use an actual version like
4.14.3instead of4-snapshot. Release tags on Docker Hub are not overwritten. (This was the option I decided to use in this case) - Pin to a digest. If you do need a snapshot build for a specific feature, pull it once, then reference it by digest (
dependencytrack/apiserver@sha256:...) instead of by tag. That freezes the exact image, snapshot or not.
services:
dtrack-apiserver:
image: dependencytrack/apiserver@sha256:<digest-you-pinned>
dtrack-frontend:
image: dependencytrack/frontend@sha256:<digest-you-pinned>
Tip: if you deliberately want to track a moving snapshot (for example while validating a v5 pre-release), that's fine, just be conscious of it. Document it, and don't be surprised when behavior shifts under you.
That's it. Not a Dependency-Track bug, just a reminder that "snapshot" means what it says.