Skip to content
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

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ gmimage lcimage kbimage:
docker build --build-arg GO_LDFLAGS=${GO_LDFLAGS} -t ${IMAGE_REPO}/sedna-${@:image=}:${IMAGE_TAG} -f build/${@:image=}/Dockerfile .


.PHONY: push push-examples push-all push-multi-platforms
.PHONY: push push-examples push-all push-multi-platform-images
push-all: push-multi-platform-images push-examples

# push target pushes sedna-built images
Expand All @@ -154,6 +154,7 @@ push: images

push-examples:
bash examples/push_image.sh

# push multi-platform images
push-multi-platform-images:
bash hack/make-rules/push.sh
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/buildx.sh
Original file line number Diff line number Diff line change
Expand 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}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

From buildx official docs, it is BUILDPLATFORM

Copy link

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?

Copy link

@llhuii llhuii Nov 1, 2021

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

sed "/AS builder/s/FROM/FROM --platform=\$TARGETPLATFORM/g" ${dockerfile}
Copy link

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

}

sedna::buildx::push-multi-platform-images() {
Expand Down