-
Notifications
You must be signed in to change notification settings - Fork 834
stage_executor: reset platform in systemcontext for every stage. #5971
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
Changes from all commits
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 |
---|---|---|
|
@@ -6573,6 +6573,18 @@ _EOF | |
done | ||
} | ||
|
||
@test "build must reset platform for stages if needed" { | ||
run_buildah info --format '{{.host.arch}}' | ||
myarch="$output" | ||
otherarch="arm64" | ||
# just make sure that other arch is not equivalent to host arch | ||
if [[ "$otherarch" == "$myarch" ]]; then | ||
otherarch="amd64" | ||
fi | ||
run_buildah build $WITH_POLICY_JSON --build-arg FOREIGNARCH=$otherarch -f $BUDFILES/multiarch/Containerfile.reset-platform $BUDFILES/multiarch | ||
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. This should also test a case where the the TARGETPLATFORM build-arg is set, so that we don't regress on that. 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. I added a test which sets TARGETPLATFORM using 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. I mean literally setting |
||
run_buildah build $WITH_POLICY_JSON --build-arg TARGETPLATFORM=linux/$myarch --build-arg FOREIGNARCH=$otherarch -f $BUDFILES/multiarch/Containerfile.reset-platform $BUDFILES/multiarch | ||
} | ||
|
||
# * Performs multi-stage build with label1=value1 and verifies | ||
# * Relabels build with label1=value2 and verifies | ||
# * Rebuild with label1=value1 and makes sure everything is used from cache | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ARG FOREIGNARCH | ||
FROM --platform=linux/$FOREIGNARCH busybox AS foreign | ||
FROM busybox | ||
COPY --from=foreign /bin/busybox /bin/busybox.foreign | ||
RUN arch | ||
RUN ls -l /bin/busybox /bin/busybox.foreign | ||
RUN ! cmp /bin/busybox /bin/busybox.foreign |
Uh oh!
There was an error while loading. Please reload this page.