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

Build multi-arch docker images #944

Merged
merged 6 commits into from
Mar 2, 2023
Merged

Build multi-arch docker images #944

merged 6 commits into from
Mar 2, 2023

Conversation

antonincms
Copy link
Contributor

@antonincms antonincms commented Feb 18, 2023

Fixes issue #939

Proposed Changes

On a M1 / M2 mac the performance are 5x worse for our use case if using the amd64 docker.
We would like to have the possibility of using a multi-plateform image, and this PR allows that :

  • Update the Dockerfile to use the TARGETARCH environment variable to pull the correct version of go.
  • Update the docker-image github action pipeline to setup QEMU and buildx,
    and then building multi-plateform images of kapitan.

Building an image on a computer of the same architecture should work as previously.
I could add some documentation on how to do locally what the CI does (build a multi-arch image with a single tag).

This was inspired by this bit of documentation about building multi-plateform images : https://docs.docker.com/build/ci/github-actions/examples/#multi-platform-images
There is also this more general documentation about how to set this up outside of CI : https://docs.docker.com/build/building/multi-platform/

@uberspot uberspot self-requested a review February 22, 2023 18:27
@uberspot
Copy link
Contributor

Overall looks good. I've rebased to re-run tests.
Also I could add some documentation on how to do locally what the CI does (build a multi-arch image with a single tag).
It would be indeed beneficial if you added a pointer for this. Maybe as a comment in the makefile or in contributing.md. Either works (?)

@antonincms
Copy link
Contributor Author

I added some comments in the CI and a paragraph in the README, is it ok ?

Copy link
Member

@ramaro ramaro left a comment

Choose a reason for hiding this comment

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

looks good, thank you @antonincms !

@ramaro ramaro merged commit 5406935 into kapicorp:master Mar 2, 2023
@antonincms antonincms deleted the multi-arch branch March 2, 2023 13:09
@antonincms
Copy link
Contributor Author

Thank you for the review !

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.

4 participants