-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Take a compile time variable from the linker to set arm variant #996
Take a compile time variable from the linker to set arm variant #996
Conversation
…ulling Docker images
@@ -144,8 +147,20 @@ func SHA256(r io.Reader) (string, error) { | |||
|
|||
// CurrentPlatform returns the v1.Platform on which the code runs | |||
func currentPlatform() v1.Platform { | |||
var archVariant string | |||
if strings.HasPrefix(runtime.GOARCH, "arm") { |
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.
I am little confused how this works.
IIUC, we build a Kaniko binary on my local environment. It would contain the arm
and archVariant
thats on my machine right?
Does this mean, our Dockerfile should also change?
FROM golang:1.12
ARG GOARCH=amd64
Thanks you for your contribution @PhoenixMage! Some |
GOARCH is set at runtime and based on the previous patch that was merged it
resolved the architecture at a high level.
This works by embedding GOARM as a symbol in the code when it is linked
(the variable goarm and the -X in the make file) so the kaniko version is
essentially locked to a variant.
The archVariant is the format docker expects the variant to be in.
That being said I don't believe the docker images need to change as it
should pull the correct base OS, GOARCH will be determined from that and
variant will be locked from compile time.
…On Sat, 25 Jan 2020, 04:20 Tejal Desai, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/util/util.go
<#996 (comment)>
:
> @@ -144,8 +147,20 @@ func SHA256(r io.Reader) (string, error) {
// CurrentPlatform returns the v1.Platform on which the code runs
func currentPlatform() v1.Platform {
+ var archVariant string
+ if strings.HasPrefix(runtime.GOARCH, "arm") {
I am little confused how this works.
IIUC, we build a Kaniko binary on my local environment. It would contain
the arm and archVariant thats on my machine right?
Does this mean, our Dockerfile should also change?
FROM golang:1.12
ARG GOARCH=amd64
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#996?email_source=notifications&email_token=AAOQBS27ZSJPZMVQK3V6CWDQ7MPPXA5CNFSM4KK7NEV2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCS72OQQ#pullrequestreview-348104514>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOQBS3GKGFQX7JI3ROWY2DQ7MPPXANCNFSM4KK7NEVQ>
.
|
closed due to inactivity |
Fixes issue #992
Description
Takes a compile time variable from the linker to set the Arm variant for pulling from docker hub.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.