https://pantsbuild.org/ logo
#general
Title
# general
n

nutritious-hair-72580

11/24/2022, 4:31 PM
Any thoughts on best practices for creating unique docker tag values for use with immutable repositories? After some research (this article presents some key considerations), I'm thinking of running with something like •
<trimmed branch name>--<git short commit sha>--<github actions build attempt number>
for CI builds and •
<trimmed branch name>-<git short commit sha>--<timestamp>
for local builds Curious what others are doing, and if an opinionated version (if a starting point) could be added to the docs or a blog post.
c

curved-television-6568

11/24/2022, 4:34 PM
n

nutritious-hair-72580

11/24/2022, 4:38 PM
Yes, that's pretty helpful. I think it would be enough for our project, but was trying to come up with a more generic version for the org which may have non-pants builds. Can push both of course.
c

curved-television-6568

11/24/2022, 4:50 PM
ah, right. yea this one’s pretty specific 😅
n

nutritious-hair-72580

11/24/2022, 5:37 PM
Actually, now that I think of it,
{pants.hash}
is not useful for immutable rego, because if the github workflow runs again, it will try to push the same value which won't be allowed. I've got
"gitHash-{build_args.GIT_COMMIT}-buildId-{build_args.BUILD_ID}"
working for now.
2 Views