-
Notifications
You must be signed in to change notification settings - Fork 118
fix: multi-platform build #2400
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
e583d53
to
d201d5a
Compare
|
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.
This approach causes churn in the docker builds due to unnecessary cache invalidation. We should ensure the correct build arch is set in our build process instead.
@@ -3,6 +3,7 @@ | |||
# must-have toplevel files | |||
!/go.sum | |||
!/go.mod | |||
!/Makefile |
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.
Adding this makes the docker cache invalidated on changes to the makefile. That should not happen as it does not affect the built binary.
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg \ | ||
GOARCH=$TARGETARCH \ |
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.
Why not set this in the build pipeline?
+1 to this approach as it will persist the value during runtime. |
|
Superseded by #2411 |
resolves #2399