GH-2282 Add Docker tags for Major and Major.Minor versions #2285
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.
Purpose
This pull request enhances the Docker image tagging process by adding additional tags for
Major
andMajor.Minor
versions alongside the existinglatest
and full release version tags.Why this change?
Using only
latest
or the full version (e.g.,3.5.19
) for Docker tags can make managing updates more challenging, especially for users who want to restrict updates to specific major or minor versions. For example:3.5
allows users to get updates within the3.5.x
series while avoiding potential changes in version3.6
without explicit changing the tag.3
tag ensures updates only within the3.x
series to avoid auto updates with breaking changes.Adding these tags provides users with more flexibility and control over updates in their environments.
What was changed?
docker
job in the GitHub Actions workflow now generates the following tags for Docker images:latest
Major.Minor
(e.g.,3.5
)Major
(e.g.,3
)3.5.19
)How does it work?
Generate Docker Tags
) extracts theMajor
andMinor
parts of the version from${{ needs.github.outputs.version }}
.docker/build-push-action
, ensuring all tags are applied to the built image and pushed to the registries.Testing
While testing was limited due to the lack of actual registry credentials, the logic for tag generation was validated independently to ensure correctness.
Fixing #2282
It might be possible to update parts of the documentation, but I wasn't sure if and where it would make sense.
Additional notes:
During my tests with GitHub workflows i saw the following warning:
I also used
set-output
because it is already used in the workflow.