-
Notifications
You must be signed in to change notification settings - Fork 237
fix(docker): set initiad version in docker image #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
📝 WalkthroughWalkthroughThis update introduces new build arguments in the Dockerfile and modifies the Makefile's handling of versioning variables. The Dockerfile now declares Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant M as Makefile
participant G as Git
participant D as Docker Build
U->>M: Invoke build process
M->>M: Check if COMMIT is set
alt COMMIT not set
M->>G: Retrieve latest COMMIT via `git log`
G-->>M: Return commit hash
end
M->>D: Execute docker build with VERSION & COMMIT
D->>Dockerfile: Build command uses both arguments
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Makefile (1)
14-20
: Fallback Mechanism for VERSION:
The logic first attempts to setVERSION
viagit describe --tags
and, if that yields an empty value, falls back to the pattern$(BRANCH)-$(COMMIT)
. This provides a robust fallback mechanism. Although functionally sound, consider refactoring or adding comments to clarify the nested conditionals for future maintainers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
.github/workflows/docker.yml
is excluded by!**/*.yml
📒 Files selected for processing (2)
Dockerfile
(2 hunks)Makefile
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (go)
🔇 Additional comments (4)
Dockerfile (2)
7-8
: Build Arguments Addition:
The addition of theARG VERSION
andARG COMMIT
lines enhances the traceability of the Docker image by allowing version and commit information to be injected at build time. Ensure that these arguments are supplied during the build process when required.
41-41
: Updated Build Command with Versioning Info:
The RUN command now propagates theVERSION
andCOMMIT
values into the build process, which is essential for embedding accurate metadata into the binary. Double-check that the complex quoting aroundLDFLAGS
(with the escaped quotes) behaves as intended in your shell environment.Makefile (2)
9-12
: Preservation of User-Defined COMMIT:
The conditional assignment forCOMMIT
(“if empty, then set it using git log”) is a good approach to preserve any user-defined value, ensuring that it isn’t inadvertently overridden.
72-77
: Embedding Versioning Information in ldflags:
Theldflags
now include$(VERSION)
and$(COMMIT)
to ensure that the built binary contains accurate version metadata. This change maintains consistency with the Dockerfile modifications and is well integrated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...