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

Expand Docker image tagging #919

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Expand Docker image tagging #919

wants to merge 7 commits into from

Conversation

Oscariremma
Copy link
Member

@Oscariremma Oscariremma commented Nov 3, 2024

This PR expands the Docker image tags to be more extensive.

As written this workflow will create the following tags in the following scenarios.

On push/merge to main:

  • :main :edge
  • :sha-xxxxxxx where xxxxxxx is the start of the git commit hash

On PR targeting main:

  • :pr-xx-head where xx is the PR number
  • :sha-xxxxxxx where xxxxxxx is the start of the git commit hash

On Git tag:

  • :sha-xxxxxxx where xxxxxxx is the start of the git commit hash
  • :x where x is the major version
  • :x.y where x is the major version and y the minor
  • :x.y.z :x.y where x is the major, y the minor and z is the patch version
  • :latest

Before I mark this draft PR as ready to merge I would like some feedback on which of these tags we actually want. For now I have basically included everything but I don't know if we only want some subset of these or if we like this extensive system?

@GAsplund
Copy link
Member

GAsplund commented Nov 3, 2024

I think that this tag structure would be very useful! However, I'm thinking about how we should name the image with the latest version of existing code. If seen outside of the context of this repo (say in the situation where this was on the Docker hub), main wouldn't say much. I'm thinking if maybe one of dev, unstable or nightly would make more sense?

Also, latest should probably be pushed to when a (valid) tag is published

@Oscariremma
Copy link
Member Author

I think that this tag structure would be very useful! However, I'm thinking about how we should name the image with the latest version of existing code. If seen outside of the context of this repo (say in the situation where this was on the Docker hub), main wouldn't say much. I'm thinking if maybe one of dev, unstable or nightly would make more sense?

Also, latest should probably be pushed to when a (valid) tag is published

I think the thought behind having :main as the tag is that it represents what is on the branch main. If we add a dev branch the tag would be called :dev. I do however see your point, and if we rename it to something else my vote would probably be on nightly or unstable not dev to avoid confusion with an actual dev branch that was used previously in this repo. Personally I probably prefer main but I don't have a super strong opinion. (As a side note, if we want to use something that is not just the branch name we need some custom logic for that as extracting the branch name is a built in feature of the docker-metadata action we are currently using.)

As for :latest it will be created whenever a Git tag is created. Just forgot to list it but I have edited the description now.

@GAsplund
Copy link
Member

GAsplund commented Nov 3, 2024

I think my reasoning is that having an explicit tag for marking the latest revision of the code is good. I would agree that dev might risk causing confusion, but after more consideration, unstable might be a bit harsh. Maybe nightly would be best? @Portals do you also have any opinions on this?

@Oscariremma
Copy link
Member Author

After doing some more googling I don't think nightly is technically correct. This is usually generated on a schedule once every night (which docker metadata action has support for).

@Oscariremma
Copy link
Member Author

Oscariremma commented Nov 4, 2024

It does look like it is possible to add pre/postfixes to the branch names. So we could do something like main-branch docs if that feels better?

@Oscariremma
Copy link
Member Author

There is also something called edge which seams to be used by Alpine for example. So :edge would be the latest commit on main.

@GAsplund
Copy link
Member

GAsplund commented Nov 5, 2024

Yeah, edge feels pretty good. I also saw that Busybox uses unstable, so that may also work despite the impression it gives.

@Oscariremma
Copy link
Member Author

I think I like edge over unstable. So from my point of view ether :main or :edge sounds best

@GAsplund
Copy link
Member

GAsplund commented Nov 5, 2024

I will vote for :edge!

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.

2 participants