Skip to content

Push a minor version tag next to each patch tag - #100

Open
fjvbn2003 wants to merge 1 commit into
alpine-docker:masterfrom
fjvbn2003:feat/minor-version-tag
Open

fjvbn2003 wants to merge 1 commit into
alpine-docker:masterfrom
fjvbn2003:feat/minor-version-tag

Conversation

@fjvbn2003

Copy link
Copy Markdown
Contributor

Closes #98.

Several issues (#90, #96, #97) came from charts that build the image tag from the cluster version. When the pipeline skips a patch release, for example because builds failed for a few weeks, that patch tag never exists and the pull fails. #98 asks for a tag that follows the minor version instead.

This PR adds one more -t to the docker buildx build --push call in build.sh:

       -t ${image}:${tag} \
+      -t ${image}:${tag%.*} .

So a master build of 1.35.9 also pushes 1.35. Each run only builds the newest patch of each minor version, so the minor tag always moves forward to the newest patch image. No new tool or registry call is needed. The README gets one paragraph about the new tag.

What I checked: I ran build.sh with docker and sudo replaced by stubs that only print their arguments (CIRCLE_BRANCH=master REBUILD=true, no build or push):

Found k8s latest versions: 1.37.1 1.36.5 1.35.9 1.34.12
before: docker buildx build --no-cache --push --platform=linux/amd64,linux/arm64 -t alpine/k8s:1.37.1 .
after:  docker buildx build --no-cache --push --platform=linux/amd64,linux/arm64 -t alpine/k8s:1.37.1 -t alpine/k8s:1.37 .
        (same for 1.36.5 -> 1.36, 1.35.9 -> 1.35, 1.34.12 -> 1.34)

None of 1.34, 1.35, 1.36 or 1.37 exist on Docker Hub today, so nothing is overwritten. I did not run a real multi-arch build or push.

Note: the minor tag only moves when a new patch image is built (or with REBUILD=true), the same as the patch tags today.

I used an AI assistant (Claude) to help find and draft this change. I reviewed it and ran the checks above myself.

🤖 Generated with Claude Code

Each master build now also tags the image as `<major>.<minor>` (for
example `1.35` next to `1.35.9`). The minor tag always follows the newest
patch image built for that minor version.

Charts that derive the image tag from the cluster version break whenever
a patch tag was skipped by the pipeline (alpine-docker#90, alpine-docker#96, alpine-docker#97). A minor tag lets
them follow the cluster's major.minor instead. Closes alpine-docker#98.

Signed-off-by: YoungjuKim <fjvbn2003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

add a tag following only minor version

1 participant