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

chore: Build docker images on runner arch #180

Merged
merged 2 commits into from
Jan 23, 2025
Merged

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Jan 21, 2025

This pull request changes the way how multi-arch images are built. Instead of cross-compiling on emulated architecture using multiple platforms in the docker buildx build command, it uses dedicated arm and amd runners to build images "natively" and later combining the resulting image digests into a multi-arch manifest.

Example of a successful workflow run: https://github.com/grafana/loki/actions/runs/12907676490

screenshot_20250122_150207

This commit changes the way how multi-arch images are built. Instead of
cross-compiling on emulated architecture using multiple platforms in the
docker buildx build command, it uses dedicated arm and amd runners to
build images "natively" and later combining the resulting image digests
into a multi-arch manifest.

Signed-off-by: Christian Haudum <[email protected]>
Copy link
Collaborator

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

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

Don't think I follow all the changes wrt to digest in the weekly image (ie. push-by-digest=true and the additional "Process image digest"), but I assume they have a purpose and see that you already tested this so I'm good 👍

@chaudum
Copy link
Contributor Author

chaudum commented Jan 23, 2025

Don't think I follow all the changes wrt to digest in the weekly image (ie. push-by-digest=true and the additional "Process image digest"), but I assume they have a purpose and see that you already tested this so I'm good 👍

@trevorwhitney I found this article very insightful https://andrewlock.net/combining-multiple-docker-images-into-a-multi-arch-image/

@chaudum chaudum merged commit 5343bc7 into main Jan 23, 2025
31 checks passed
@chaudum chaudum deleted the native-docker-builds branch January 23, 2025 06:50
chaudum added a commit to grafana/loki that referenced this pull request Jan 24, 2025
…15907)

**What this PR does / why we need it**:

Build Docker images "natively" on runner architecture

This PR changes the way how multi-arch images are built. Instead of cross-compiling on emulated architecture using multiple platforms in the docker buildx build command, it uses dedicated arm and amd runners to build images "natively" and later combining the resulting image digests into a multi-arch manifest.

**Special notes for your reviewer**:

Upstream changes: grafana/loki-release#180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants