Build multiplatform docker images #172
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
More specifically, this is for ARMv8 support, though we can technically build for any platform supported by QEMU, rust, and go.
Use docker buildx for building the images, and organize the build targets in a
docker-bake.hclfile fordocker buildx bake. This allowed the Makefile to become simpler while encapsulating all the Docker-specific bits in a separate file. buildx also had superior build cache management, which unfotunately doesn't work on ECR yet, so for the time being we use Dockerhub exclusively for cache.In the CI workflow, I switched from the "build once and push to multiple destinations" flow to "build and push to each destination in a single command". Build cache means we only build images once either way, and the latter fits the semantics of buildx better.
See successful CI build here: https://github.com/SumoLogic/sumologic-kubernetes-tools/runs/4333036971 and you can run
to see the multiplatform manifest.