-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,8 +130,21 @@ image.buildx.verify: | |
docker buildx version; \ | ||
fi | ||
|
||
BUILDX_CONTEXT = gateway-api-builder | ||
BUILDX_PLATFORMS = linux/amd64,linux/arm64 | ||
|
||
# Setup multi-arch enviroment | ||
# Recreate a buildx context for multi-arch images. | ||
.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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
fi | ||
docker buildx rm $(BUILDX_CONTEXT) || : | ||
docker buildx create --use --name $(BUILDX_CONTEXT) --platform "${BUILDX_PLATFORMS}" | ||
Comment on lines
+146
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
.PHONY: release-staging | ||
release-staging: image.buildx.verify | ||
release-staging: image.multiarch.setup | ||
hack/build-and-push.sh | ||
|
||
# Generate a virtualenv install, which is useful for hacking on the | ||
|
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.