-
Notifications
You must be signed in to change notification settings - Fork 779
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: when docker build in arm or other not amd64 env. #2492
Conversation
Signed-off-by: yanggang <gang.yang@daocloud.io>
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
@@ -32,12 +32,12 @@ RUN curl -sSLO https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.t | |||
bash bats-core-${BATS_VERSION}/install.sh /usr/local | |||
|
|||
# Install ORAS | |||
RUN curl -SsLO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz && \ | |||
RUN curl -SsLO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_${arch}.tar.gz && \ |
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.
can we use TARGETARCH
here? https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
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 the advice.
I search the web , docker automatic-platform-args-in-the-global-scope.
It says
Automatic platform ARGs in the global scope
This feature is only available when using the [BuildKit](https://docs.docker.com/build/buildkit/) backend.
perhaps in docker build
mod , it will no works for ..
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! LGTM, pending sozercan@'s thumbs up
Signed-off-by: yanggang gang.yang@daocloud.io
What this PR does / why we need it:
/kind bug
Special notes for your reviewer:
When build in arm env , will error , because the
RUN curl oras , yg
have the constant string 'amd64'.oras >=0.11.1 , have the arm libs.
yg release also have the arm libs.