fix: cherry-pick: include .git in Docker build context for version embedding#1623
Conversation
## 🔄 Changes Summary - Revert #1619 (which tried to fix version embedding via build-args — the approach worked locally but not in the GitHub Actions workflow since `docker/build-push-action` was not updated to pass the version build-args). - Remove `.git/` from `.dockerignore` so that `git describe` and `git rev-parse` run correctly inside the builder stage, embedding the correct `Version`, `GitRev` and `GitBranch` values in the binary without any changes to the Makefile, Dockerfile, or CI workflow. ##⚠️ Breaking Changes - None ## 📋 Config Updates - None ## ✅ Testing - 🖱️ **Manual**: `make build-docker && docker run aggkit:local version` shows correct `Version`, `Git revision` and `Git branch` fields. ## 🐞 Issues - Closes #1618 ## 📝 Notes - `.git/` was excluded from the Docker context for security and context-size reasons. Since the builder stage only uses git metadata to set ldflags and the `.git` directory is not copied into the final runtime image, the security concern does not apply. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @joanestebanr's task in 1m 43s —— View job PR Review Complete ✅🚀 What's NewThis PR fixes Docker version embedding by including 🐛 Bug Fixes
📋 Config UpdatesNone
|
|



🔄 Changes Summary
release/0.10intodevelop.git/from.dockerignoreso thatgit describeandgit rev-parserun correctly inside the builder stage, embedding the correctVersion,GitRevandGitBranchvalues in the binarybuild-aggkit-image.yml,build-push-docker-image.yml,release.yml) to include.gitin the Docker build context📋 Config Updates
✅ Testing
make build-docker && docker run aggkit:local versionshows correctVersion,Git revisionandGit branchfields🐞 Issues
🔗 Related PRs
release/0.10)📝 Notes
.git/was excluded from the Docker context for security and context-size reasons. Since the builder stage only uses git metadata to set ldflags and the.gitdirectory is not copied into the final runtime image, the security concern does not apply.Dockerfile,Makefile, andversion.mkwere not included becausedevelopalready has the correct state for those files.🤖 Generated with Claude Code