-
Notifications
You must be signed in to change notification settings - Fork 505
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
Add support for arm64 to kube-cross image #1853
Add support for arm64 to kube-cross image #1853
Conversation
We should be able to compile for say linux/arm64 using this image on arm64. We'll not be able to cross-compile on non-amd64 platforms. Signed-off-by: Davanum Srinivas <[email protected]>
/assign @hasheddan @justaugustus |
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 for adding this @dims! One nitpick below, otherwise LGTM 👍
@@ -41,8 +41,11 @@ ENV KUBE_CROSSPLATFORMS \ | |||
##------------------------------------------------------------ | |||
|
|||
# Pre-compile the standard go library when cross-compiling. This is much easier now when we have go1.5+ | |||
RUN for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done \ | |||
&& go clean -cache | |||
RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') \ |
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.
nitpick: how would you feel about setting TARGETARCH
as env var once at beginning so that we don't have to execute on each command?
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.
Apparently that does not work, i ended up eye-balling a bunch of code similar:
https://grep.app/search?q=TARGETPLATFORM&case=true&filter[lang][0]=Dockerfile
could be something wrong in my setup. could we merge and iterate please?
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.
works for me 👍
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, hasheddan 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 |
Future note: Let's make sure we bump the image tags on these changes e.g., |
We should be able to compile for say linux/arm64 using this image on arm64. We'll not be able to cross-compile on non-amd64 platforms.
Notes:
make container
locallycrossbuild-essential-*
are not available on the non-amd64 platforms :( we end up with broken packages.Signed-off-by: Davanum Srinivas [email protected]
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?