-
Notifications
You must be signed in to change notification settings - Fork 165
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 building wrong GM/LC arm64 docker images #215
Conversation
Signed-off-by: JimmyYang20 <yangjin39@huawei.com>
Please check this comment.
fix it , reference: https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images Originally posted by @JimmyYang20 in #196 (comment) |
/hold |
@@ -38,7 +38,7 @@ sedna::buildx::prepare_env() { | |||
|
|||
sedna::buildx:generate-dockerfile() { | |||
dockerfile=${1} | |||
sed "/AS builder/s/FROM/FROM --platform=\$BUILDPLATFORM/g" ${dockerfile} |
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.
From buildx official docs, it is BUILDPLATFORM
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.
Did you add ARG TARGETPLATFORM
build instruction?
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.
In GM/LC Dockerfile, we need to pass TARGETPLATFORM to GOARCH for go build
, arm64
Just make cross build images work, I will merge this. I will open another pull request for speed this up. |
@@ -38,7 +38,7 @@ sedna::buildx::prepare_env() { | |||
|
|||
sedna::buildx:generate-dockerfile() { | |||
dockerfile=${1} | |||
sed "/AS builder/s/FROM/FROM --platform=\$BUILDPLATFORM/g" ${dockerfile} | |||
sed "/AS builder/s/FROM/FROM --platform=\$TARGETPLATFORM/g" ${dockerfile} |
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.
Note: this has same effect as cat $dockerfile
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: llhuii 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 |
/unhold |
Signed-off-by: JimmyYang20 yangjin39@huawei.com