Skip to content

Docker publish workflow: Create docker-publish.yml#1776

Merged
pbiering merged 1 commit intoKozea:masterfrom
kalsi-avneet:docker-workflow
May 5, 2025
Merged

Docker publish workflow: Create docker-publish.yml#1776
pbiering merged 1 commit intoKozea:masterfrom
kalsi-avneet:docker-workflow

Conversation

@kalsi-avneet
Copy link
Collaborator

@kalsi-avneet kalsi-avneet commented May 1, 2025

  • Build using the Dockerfile and publish to ghcr.io (Github's container registry)

  • Trigger on release

  • Create the following tags based on the release git tag.

    For example, for a git tag v1.2.3, the following docker tags will be created:

    • 1.2.3 (version)
    • 1.2 (major.minor) <-- Removed as per review
    • 1 (major) <-- Removed as per review
    • latest

    Note: Depends on the git tag following semantic versioning.

@pbiering
Copy link
Collaborator

pbiering commented May 4, 2025

1.2 (major.minor) + 1 (major) makes no sense, only (latest) release + (latest) upstream makes sense, please adjust, thank you!

* Build using the `Dockerfile` and publish to `ghcr.io`
* Trigger on release
* Create the following tags based on the release git tag.

    For example, for a git tag `v1.2.3`, the following docker tags will be created:
    * `1.2.3` (version)
    * `latest`

    Note: Depends on the git tag following semantic versioning.
@kalsi-avneet
Copy link
Collaborator Author

1.2 (major.minor) + 1 (major) makes no sense, only (latest) release + (latest) upstream makes sense, please adjust, thank you!

Thank you for the review. I have removed the following as per your suggestion:

  • 1.2 (major.minor)
  • 1 (major)

Copy link
Collaborator

@pbiering pbiering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@pbiering pbiering added this to the 3.5.3 milestone May 5, 2025
@pbiering pbiering added the packaging:external related to packaging by externals (e.g. distributions) label May 5, 2025
@pbiering pbiering self-assigned this May 5, 2025
@pbiering pbiering merged commit 7a272fa into Kozea:master May 5, 2025
19 checks passed
@pbiering
Copy link
Collaborator

pbiering commented May 8, 2025

@kalsi-avneet - would it make sense to create in addition "latest" on every push or pull-request using the commit hash instead of the release in the name? And somehow remove former "latest" ones in a cycled way, e.g. keep the last 10 images or only with creation time of the last 30 days?

@kalsi-avneet
Copy link
Collaborator Author

Hi @pbiering,

would it make sense to create in addition "latest" on every push or pull-request using the commit hash instead of the release in the name?

Let me confirm my understanding. The requirement is to create a docker image whenever:

  • A commit is pushed to some branch (Let us assume master for this case), and
  • A pull request is created

And the tag of the docker image should be the commit hash.

The above should be done in addition to creating images for every release.

Please confirm if my understanding same as yours.


I believe a few things need to be considered and discussed:

  1. In the case of "on every push", should the image creation trigger be limited to git commit push to a particular branch (e.g. master)? if so, please share the branch/list of branches.
  2. I am concerned that creating an image on every push might result in a lot of images especially if there is active development (lots of commits). Please share your opinion if it is ok to go ahead with this.
  3. Since it is possible for a pull-request to contain multiple commits, I think it might be better to tag using the pull-request ID or something else instead of just commit hash. Please share your opinion.

And somehow remove former "latest" ones in a cycled way, e.g. keep the last 10 images or only with creation time of the last 30 days?

Yes, I think it would be possible. But the implementation would differ based on where the images are stored - github registry or dockerhub registry.
Allow me some time to do a little feasibility study and get back to you.

@pbiering
Copy link
Collaborator

pbiering commented May 8, 2025

instead of using push/pull-request as a trigger, can be a nightly image creation scheduled? Or e.g. trigger the "upstream" image generation manually from time to time?

@kalsi-avneet
Copy link
Collaborator Author

instead of using push/pull-request as a trigger, can be a nightly image creation scheduled? Or e.g. trigger the "upstream" image generation manually from time to time?

Yes, that can be done. I will create a PR for this.

Later, I will create another PR for cleanup

@kalsi-avneet
Copy link
Collaborator Author

@pbiering ,

Raised #1779 for your request:

instead of using push/pull-request as a trigger, can be a nightly image creation scheduled? Or e.g. trigger the "upstream" image generation manually from time to time?

Summary of PR:

  • Trigger docker image creation automatically at 00:00 UTC daily.
  • Ability to trigger image creation manually.

@pbiering pbiering added packaging:container related to container packaging and removed packaging:external related to packaging by externals (e.g. distributions) labels Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packaging:container related to container packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants