calico icon indicating copy to clipboard operation
calico copied to clipboard

Enable Native Building for Node Image on arm64

Open TrevorTaoARM opened this issue 2 years ago • 4 comments

This PR enables the native building for node image on arm64 platform which fixes the error met and adds target arch build-arg to enable possible unified Dockerfile in the future. The native building for Node image on arm64 is needed for running the e2e test on arm64.

When building on native arm64 platform(not cross-building on amd64), the modification to Runit source code is not needed and must be ignored to avoid building errors.

And we switch to use the same set of Runit src code as that of amd64 which would be more consistent for both platforms.

Verified the building both on amd64(crossbuilding) and arm64.

Signed-off-by: TrevorTaoARM [email protected]

Description

Related issues/PRs

Todos

  • [ ] Tests
  • [ ] Documentation
  • [ ] Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

TrevorTaoARM avatar Apr 15 '22 08:04 TrevorTaoARM

/sem-approve

frozenprocess avatar Apr 22 '22 02:04 frozenprocess

Hey @TrevorTaoARM , bumping this to see if we can get any movement on this. Do we know where BUILDPLATFORM is intended to be set?

mgleung avatar Sep 19 '22 22:09 mgleung

Hey @TrevorTaoARM , bumping this to see if we can get any movement on this. Do we know where BUILDPLATFORM is intended to be set?

The Arg BUILDPLATFORM and TARGETPLATFORM are automatically added by docker build system by the parameter: --platform=linux/arm64/v8 in lib.Makefile. Besides the above info I provided, another ref link to this issue: https://docs.docker.com/engine/reference/commandline/buildx_build/ Another link: https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ image image

TrevorTaoARM avatar Sep 20 '22 04:09 TrevorTaoARM