4 ms·
There are a number of incorrect statements in this post. 1) One should neither be using the "latest" nor just the "version" tag as the version can still vary d
by newman314 3y ago
There are a number of incorrect statements in this post.
1) One should neither be using the "latest" nor just the "version" tag as the version can still vary depending on when it is pulled.
Instead, one should use a combination of version + hash, say alpine:3.18.2@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1 for reproducibility reasons. This provides for human readable versions as well as the specific hash.
2) Next, afaik, Compose has removed the need for version tags. All of the compose.yml files that I now use do not specify versions.
See https://github.com/compose-spec/compose-spec/blob/master/04-version-and-name.md https://github.com/compose-spec/compose-spec/blob/master/04-...
- dikei 3y ago"version + hash" is ugly though. I trust the publisher of my base image to keep compatibility even if they update their image and trust my test suites to detect any issues, so I just use version without the hash nowadays.
- cratermoon 3y ago> I trust the publisher of my base image to keep compatibility even if they update their image That's how we get hacks like SolarWinds and MOVEit.
- dikei 3y agoUsing hash doesn't protect you from supply chain attack either. If the publisher is compromise, any updates could potentially be malicious. The alternative is to never update at all, which can be even worse.
- cratermoon 3y agoIt doesn't completely protect, no. Nothing does. Like much in security, defense in depth is the byword. Not checking the hash throws away a layer.