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

Enable creation of multi-arch docker images #2914

Merged
merged 24 commits into from
Apr 12, 2024
Merged

Conversation

marun
Copy link
Contributor

@marun marun commented Apr 4, 2024

Currently images are only published for amd64. To enable testing and development on arm64, this PR:

  • Enables build and publication of multi-arch images that support both amd64 and arm64
    • Non-native builds should be fast on either arch thanks to cross-compilation
  • Retains the existing single-arch local image by default
  • Adds a new test job to validate both single and multi-arch image builds
    • The test checks that /avalanchego/build/avalanchego --version runs without error, indicating that the image and its binary are sane for the intended arch

This ended up being a lot more work than I expected - lots of ways to get multiarch builds wrong and the different options (docker build + docker manifest vs docker buildx) each having their own gotchas. The test script ended up being invaluable since at many stages the images were building without error but ending up invalid for the intended arch due to subtle problems with build configuration in the Dockerfile.

TODO:

  • POST-MERGE: Require the new Image build job

@marun marun self-assigned this Apr 4, 2024
@marun marun changed the title Build cross-compiled arm64 binary for testing Enable creation of linux/arm64 images Apr 4, 2024
@marun marun changed the title Enable creation of linux/arm64 images Enable creation of multi-arch docker images Apr 5, 2024
@marun marun force-pushed the docker-arm64-image branch 4 times, most recently from 5752f75 to 67391f3 Compare April 5, 2024 16:39
@marun marun marked this pull request as ready for review April 5, 2024 16:39
@marun marun force-pushed the docker-arm64-image branch 2 times, most recently from c29e8ea to f976978 Compare April 5, 2024 17:26
Dockerfile Show resolved Hide resolved
@marun marun force-pushed the docker-arm64-image branch 3 times, most recently from d872bbb to c810c2e Compare April 9, 2024 14:58
@StephenButtolph StephenButtolph added this to the v1.11.5 milestone Apr 9, 2024
@marun marun force-pushed the docker-arm64-image branch 3 times, most recently from 4d2e90d to e672f48 Compare April 10, 2024 09:44
@marun marun force-pushed the docker-arm64-image branch 2 times, most recently from 513e7d7 to 6ae6d40 Compare April 10, 2024 09:58
@marun marun added the ci This focuses on changes to the CI process label Apr 10, 2024
Copy link
Contributor

@StephenButtolph StephenButtolph left a comment

Choose a reason for hiding this comment

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

lgtm - images seem to be getting pushed to the dockerhub repo correctly 👍

@StephenButtolph StephenButtolph merged commit a804ae1 into master Apr 12, 2024
18 checks passed
@StephenButtolph StephenButtolph deleted the docker-arm64-image branch April 12, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This focuses on changes to the CI process
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants