Repository navigation
ci(docker): tag the images with the commit date and label them with the commit - #26267
Conversation
…he commit The second tag of every image becomes <branch or tag>-<commit date>-<commit>, e.g. v4.1.x-develop-20261027T145204-9fffe59, so it shows which line and when, and stays unique. The date is the commit date that already serves as the HTML5 client's build id, so a re-run of a commit gives the same tag. The images also get the labels org.opencontainers.image.revision and org.opencontainers.image.version, so a pulled image shows where it comes from with docker inspect.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 4
Please check the settings in the CodeRabbit UI or the
|
antobinary
left a comment
There was a problem hiding this comment.
I reviewed this against v4.1.x-develop (9fffe59, which is its base). It merges cleanly there, and also with #26186 and #26217.
| Check | Result |
|---|---|
| actionlint 1.7.7 (with shellcheck) on the workflow | PASS, no findings |
docker buildx bake --print with the new --set lines: both labels appear on every target, next to source |
PASS |
A build with the two labels replaces the base image's revision and version (local build from the pinned nginx-unprivileged) |
PASS |
The date command gives the same value on every run for a given commit (20261026T105204 for 9fffe59), so a re-run gets the same tag |
PASS |
The labels fix more than the description says. The published :v4.1.x-develop images currently show their base image's values. nginx, html5-client, learning-dashboard and playback have revision=bb7393196554… (a docker-nginx-unprivileged commit) and version=1.30.6-alpine. apps-akka, web, graphql-server and record-and-playback have version=24.04. After this PR, both labels show BBB's commit and version.
1. This drops the tag you can build from a commit alone, and #26186 still documents it. Today, the image for a given commit is v4.1.x-develop-<sha7>. After this PR, you also need that commit's date in the committer's time zone. #26186 points users at the old form in .env.sample line 10 (v4.1.x-develop-<commit> pins a set of images built together) and in docker/README.md line 156. The two PRs merge without a conflict, so nothing will flag that text going stale. Keeping the short-commit tag as a third tag costs one argument, and then the text in #26186 stays correct:
- docker buildx imagetools create -t "$image" -t "$BBB_IMAGE_REGISTRY/bbb-$t:$VERSION" "${sources[@]}"
+ docker buildx imagetools create -t "$image" -t "$image-${GITHUB_SHA::7}" -t "$BBB_IMAGE_REGISTRY/bbb-$t:$VERSION" "${sources[@]}"If you prefer to drop that tag, #26186 needs to change instead.
2. The date is the committer's local time, not UTC. --date=format: keeps the commit's own offset. The last 400 first-parent commits on v4.1.x-develop (since July 2025) are at -0300 (240), -0400 (127) and -0500 (33). Because of that, a later merge can get an earlier date: 5 of those 400 would have produced a tag dated before the previous one. Example: c1ca642 at 14:17:30 -0300, then 105a832 at 12:33:59 -0500, 16 minutes later. Sorting the tags will usually work but not always. This is the same value as the HTML5 client build id, so I would not change it here. A note in the README that it is the committer's local time is enough. If sortable tags matter more than matching the client build id, the alternative is TZ=UTC0 git log -n1 --pretty=format:%cd --date=format-local:%Y%m%dT%H%M%SZ (20261026T145204Z for 9fffe59).
Related: the example in the workflow comment, v4.1.x-develop-20261027T145204-9fffe59, is not what the command gives for 9fffe59 (20261026T105204). The README uses a made-up commit, which avoids that.
3. The nginx-based images still show nginx-unprivileged's other labels. nginx, html5-client, learning-dashboard and playback still carry title=docker-nginx-unprivileged, url=https://github.com/nginx/docker-nginx-unprivileged, description=Unprivileged NGINX Dockerfiles, created, licenses=Apache-2.0 and maintainer from the base image. Since the point of the PR is that docker inspect shows where an image comes from, two more lines in the same set: block would cover the misleading ones. description, created, licenses and maintainer are your call:
*.labels.org.opencontainers.image.version=${{ env.VERSION }}
+ *.labels.org.opencontainers.image.title=bbb-${{ matrix.target }}
+ *.labels.org.opencontainers.image.url=https://github.com/bigbluebutton/bigbluebuttonactionlint passes with both diffs applied, and bake --print shows the two labels. I could not run the workflow itself.
Nit: the version string is now built twice, once in the build job and once in the merge job. If one changes later and the other does not, the label and the tag will disagree. Computing it once in the targets job and passing it as an output would avoid that.
|
@antobinary thanks, all four points are in one new commit:
actionlint 1.7.8: no findings; |
🚨 Automated tests failed |
710b75b
into
bigbluebutton:v4.1.x-develop
|
@antobinary I switched the date to UTC everywhere, in one new commit (362a76d). Here is why it matters beyond the image tags, and what changes. The date is also in the package version. The change: the two places that compute the date now use the same command: TZ=UTC0 git log -n1 --pretty=format:%cd --date=format-local:%Y%m%dT%H%M%S
There is no other place in the repository that computes it. Package version, client build id and image tag stay the same value, and now sort by date. The README no longer needs the time-zone note. The format stays the same, without a The switch is safe. The last 400 commits are all at -0300, -0400 or -0500, so UTC moves their dates 3 to 5 hours forward: the first UTC build is newer than every build before it. Only a commit from a committer east of UTC (e.g. +0200) could get a UTC date up to 2 hours before an earlier local-time build, once, at the switch; there is none in the last 400. actionlint and shellcheck find nothing; it still merges cleanly with #26186 and #26217. |
v4.1.x-develop gained bigbluebutton#26219, bigbluebutton#26267, bigbluebutton#26217, bigbluebutton#26248, bigbluebutton#26348 and three Dependabot image bumps since 9fffe59. They merge cleanly; the merge is here so that the two commits that follow can change bigbluebutton-web/Dockerfile and build-all-images.yml as those files now are on 4.1.
What does this PR do?
<branch or tag>-<commit date>-<commit>, e.g.v4.1.x-develop-20261026T105204-9fffe59, next to the existing<branch or tag>and<branch or tag>-<commit>. It shows which line and when. The date is the commit date the workflowalready uses as the HTML5 client's build id (
CLIENT_BUILD, asbuild/setup.shdoes), so the tagmatches the About dialog and a re-run of the same commit gives the same tag. It is in UTC, so the tags sort by date;
build/setup.shnow uses UTC too, so the packageversion, which contains the same date, also always increases.
org.opencontainers.image.revision(the commit),org.opencontainers.image.version(the dated tag above),org.opencontainers.image.title(
bbb-<image>) andorg.opencontainers.image.url, sodocker inspectshows where a pulled imagecomes from, also when it was pulled by digest. Today the published images show their base
image's values (e.g.
title=docker-nginx-unprivileged,version=24.04).The branch/tag name itself (
v4.1.x-develop,v4.1.0) is unchanged.Closes Issue(s)
None
Motivation
The commit tags were unique but not readable; deployments that pin an image (or a digest) should
show at a glance what they run.
How to test
actionlinton the workflow: no findings.docker buildx bake -f docker-bake.hcl --printwith the four--set '*.labels.…'lines of the workflowshows the labels next to the existing
org.opencontainers.image.source.v4.1.x-developafter the merge publishes the new tag;docker buildx imagetools inspectanddocker inspecton the pulled image show the labels.