Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support publishing extra semver Docker tags #297

Closed
wants to merge 1 commit into from

Conversation

merusso
Copy link

@merusso merusso commented Sep 7, 2023

resolves #296

This change adds semver-style Docker tags {{major}} and {{major.minor}} for each release.

For example, when publishing release v3.2.1, this will push tags: 3.2.1, 3.2, 3, latest

resolves stefanprodan#296

This change adds semver-style Docker tags {{major}} and {{major.minor}}
for each release.

For example, when publishing release v3.2.1, this will push tags: 3.2.1, 3.2, 3, latest
@merusso
Copy link
Author

merusso commented Sep 7, 2023

I tested out the workflow here and it seems to work as desired: https://github.com/merusso/podinfo/actions/runs/6112999327/job/16591588138

I pushed Git tag "3.2.1", and it produced the following Docker tags:

  docker.io/stefanprodan/podinfo:3.2.1
  docker.io/stefanprodan/podinfo:3.2
  docker.io/stefanprodan/podinfo:3
  docker.io/stefanprodan/podinfo:latest
  ghcr.io/stefanprodan/podinfo:3.2.1
  ghcr.io/stefanprodan/podinfo:3.2
  ghcr.io/stefanprodan/podinfo:3
  ghcr.io/stefanprodan/podinfo:latest

I got the same result when pushing Git tag "v3.2.1"

@stefanprodan
Copy link
Owner

stefanprodan commented Sep 23, 2023

I think mutable tags are bad practice. Especially for Kubernetes where you should be using immutable tags so that on autoscaling, the replica set will not end up with diffrent versions.

@merusso
Copy link
Author

merusso commented Sep 24, 2023

For a traditional Kubernetes deployment, immutable image tags are ideal, I agree.

In other contexts, would you agree that mutable image tags are acceptable? For instance, this project already uses mutable Docker tags in its base images. It also currently pushes mutable tag latest, which is more problematic than MAJOR or MAJOR.MINOR tags in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish MAJOR and MAJOR.MINOR tags for Docker images
2 participants