Skip to content

feat: Add OCI labels for git commit and branch to docker images#493

Merged
g11tech merged 4 commits intoblockblaz:mainfrom
KatyaRyazantseva:docker-labels
Jan 25, 2026
Merged

feat: Add OCI labels for git commit and branch to docker images#493
g11tech merged 4 commits intoblockblaz:mainfrom
KatyaRyazantseva:docker-labels

Conversation

@KatyaRyazantseva
Copy link
Copy Markdown
Contributor

@KatyaRyazantseva KatyaRyazantseva commented Jan 16, 2026

Adds OCI labels to both Dockerfile and Dockerfile.prebuilt for better image traceability:

  • org.opencontainers.image.ref.name - git branch
  • org.opencontainers.image.revision - git commit

Labels are set via build args with unknown as default, so existing builds continue to work.

Updated README with build example for publishing to registries.

Build with labels:

docker build -f Dockerfile.prebuilt \
  --build-arg GIT_COMMIT=$(git rev-parse HEAD) \
  --build-arg GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \
  -t zeam:local .

Related to #91

Screenshot 2026-01-16 at 17 03 14

@KatyaRyazantseva
Copy link
Copy Markdown
Contributor Author

@g11tech ready for review

@g11tech
Copy link
Copy Markdown
Member

g11tech commented Jan 16, 2026

you will need to modify our docker image release workflow as well cc @noopur23

cc @gballet any opinions here?

Copy link
Copy Markdown
Contributor

@gballet gballet left a comment

Choose a reason for hiding this comment

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

My suggestion is that we also use this inside the build.zig to tag the executable itself, using -Dversion=$GIT_COMMIT-$GIT_BRANCH when building in auto-release.yml, but I'll leave it to you to decide if this is really interesting.

@g11tech g11tech merged commit 07f9cd7 into blockblaz:main Jan 25, 2026
12 checks passed
GrapeBaBa pushed a commit that referenced this pull request Jan 25, 2026
* feat: add OCI labels for git commit and branch to docker images

* fix: add branch label to auto-release

* fix: add git commit label to auto-release
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.

3 participants