-
Notifications
You must be signed in to change notification settings - Fork 492
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
fix: add buildx context setup before starting build #1553
fix: add buildx context setup before starting build #1553
Conversation
Signed-off-by: bitliu <[email protected]>
eb1e6e2
to
2326805
Compare
cc @wilsonwu |
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.
Thank you for your continued help through this trial and error process of getting this fixed!
I have a couple comments about leaving behind some comments to document what we've added.
.PHONY: image.multiarch.setup | ||
image.multiarch.setup: image.buildx.verify | ||
@if [ "$(shell uname)" == "Linux" ]; then \ | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes; \ |
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.
For future readers it could be helpful to add some comments about this line: firstly what it does and why its needed, and secondly a helpful link to the source of the image.
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.
Done.
docker buildx rm $(BUILDX_CONTEXT) || : | ||
docker buildx create --use --name $(BUILDX_CONTEXT) --platform "${BUILDX_PLATFORMS}" |
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.
Comments here explaining what these are doing could go a long way for future code readers as well.
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.
Done.
Signed-off-by: bitliu <[email protected]>
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.
Thanks @Xunzhuo!
I've got one tiny nit, but going to merge now and leave that for a follow up just to confirm this works.
/lgtm
/approve
BUILDX_CONTEXT = gateway-api-builder | ||
BUILDX_PLATFORMS = linux/amd64,linux/arm64 |
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.
Tiny nit: All other environment variables are defined with comments at the top of this file. I'd recommend moving these to the top as well and adding comments.
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.
Thanks, I will update it later.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: robscott, Xunzhuo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: bitliu [email protected]
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1545
Does this PR introduce a user-facing change?: