YunYouJun/cook

Maybe an unexpected behavior of docker build push action, the latest tag

henryclw opened this issue · 8 comments

There should be a tag with latest.

In my fork, the default branch is main, then when the main branch is updated, there'll be a new image pushed to docker hub with the tag of latest

type=raw,value=latest,enable={{is_default_branch}}

But now your default branch is dev, this mean the latest tag is always bounded with the branch dev, is this what you want?

You may check your docker hub repo to see what tags there are

https://hub.docker.com/r/yunyoujun/cook/tags

Yeah, i plan to remove enable={{is_default_branch}} .

Because ci will only be triggered by the main branch.

push:
branches: [main]
pull_request:
branches: [main]

Could there be other issues?

Yeah, i plan to remove enable={{is_default_branch}} .

Because ci will only be triggered by the main branch.

push:
branches: [main]
pull_request:
branches: [main]

Could there be other issues?

But the latest tag of docker is very important, because the default tag of docker image is latest

Say you run docker pull nginx, what actually it is doing is docker pull nginx:latest

So what do you want to do with the latest tag? Normally this is the latest release or the master/main branch.

And yes, currently this is only triggered by the main branch push/pr, it's all up to you to decide what kind of docker image you want to provide, if you want to provide the dev branch as well, just modify these lines of the config file.

I would recommend the latest tag to be associated with the main branch, and the dev is associated with dev branch. For normal users, just pull the latest tag, and for developer or people who want to try out the latest features, pull the dev tag. This is kind of like the stable release and the nightly release.

I don't think this contradicts what you said, I just want to remove enable={{is_default_branch}}, because the default enable is true, so it is still bound to the main branch, and main is also the representative of latest.

Was there any misunderstanding during this period?

I don't think this contradicts what you said, I just want to remove enable={{is_default_branch}}, because the default enable is true, so it is still bound to the main branch, and main is also the representative of latest.

Was there any misunderstanding during this period?

Oh, so what you want is only update docker image when the main branch is updated. And this means there's only one kind of docker image, the latest/main version, no nightly/dev version, right?

Yeah, I created a new dev branch for development and merged into the main branch after stabilization, to avoid too many unnecessary docker builds.

Okay, then this will be fine. Thank you for your kind reply, it's very nice of you.

Thanks for your feedback. I set it in d2534f7.