Skip to content

Conversation

@swiatekm
Copy link

@swiatekm swiatekm commented Nov 26, 2021

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.hcl file for docker 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

docker manifest inspect --verbose sumologic/kubernetes-tools:latest

to see the multiplatform manifest.

@swiatekm swiatekm force-pushed the feat/arm-support branch 2 times, most recently from 27e4cd9 to 7883341 Compare November 26, 2021 11:02
@swiatekm swiatekm marked this pull request as ready for review November 26, 2021 11:03
--target go-builder \
--tag $(IMAGE_NAME):$(BUILD_GO_CACHE_TAG) \
.
TAG=$(BUILD_TAG) docker buildx bake
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a nice feature 🤔

Copy link
Author

Choose a reason for hiding this comment

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

There's a bit more text in the docker-bake.hcl file than the shell commands it replaced, but I like the separation of concerns.

Mikolaj Swiatek added 2 commits November 26, 2021 13:05
Use docker buildx for building the images and a buildx bake file for orchestrating
all the builds. Notably, AWS ECR doesn't have support for the new cache
manifests, so we only store cache in Dockerhub for now.
@swiatekm swiatekm merged commit 77418fa into main Nov 26, 2021
@swiatekm swiatekm deleted the feat/arm-support branch November 26, 2021 14:22
@swiatekm swiatekm mentioned this pull request Nov 29, 2021
@andrzej-stencel andrzej-stencel linked an issue Nov 29, 2021 that may be closed by this pull request
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.

Build ARM images

3 participants