docker: consider each requirement when updating dependencies #3277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change works toward resolving #3173 with an alternate approach to #3251. It maintains grouping of updates so that we can update
php:8.0.1-apache
andphp:8.0.1-cli
in a single PR instead of two as suggested in #3251 (review).Prior to this change if there were multiple tags with different prefixes/suffixes we'd only resolve the latest version for one of them and would end up updating all of the tags to a common version:
This change resolves the latest version for each tag we can correctly preserve the prefix/suffix in the update:
One caveat is this only works if the tags are in different files. If a Dockerfile includes two tags with different prefixes/suffixes then we still end up replacing both of them with a single tag. Fixing that requires splitting out to multiple dependencies and updating the file updater to handle multiple dependencies. I started going down that road (b5b80df) but that's going to be a bigger chunk of work and I think it would be better to release this initial fix first.