-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use tonistiigi/xx for cross-platform builds #178
Conversation
Update the Dockerfile to use tonistiigi/xx to cross-compile the manager binaries natively and speed up the multi-arch image build time. Also, update github action for build to enable docker buildx. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Prevent running the test twice in build workflow by removing the dependency on docker-build on test. Signed-off-by: Sunny <darkowlzz@protonmail.com>
BUILD_PLATFORMS=linux/amd64 \ | ||
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \ | ||
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max" | ||
- # Temp fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now use -cache-from=type=gha --cache-to=type=gha,mode=max
as docker/buildx#681 was resolved.
@@ -12,13 +12,28 @@ jobs: | |||
steps: | |||
- name: checkout | |||
uses: actions/checkout@v2 | |||
- name: Setup QEMU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need qemu considering we're only building for amd64
in this workflow?
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do need it, I suppose this should be set to the subset of platforms we actually do support:
platforms: all | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since other controllers have the same configuration at the moment there's no reason for me to block this. I'll just get back with the set of changes proposed in my previous review.
Update the Dockerfile to use tonistiigi/xx to cross-compile the
manager binaries natively and speed up the multi-arch image build
time.
Refer fluxcd/flux2#1910
NOTE: Multi-arch build used to take about 6 minutes on my
machine. Cross-compiling reduces the multi-arch build to under 2
minutes.
Manually tested the built image on amd64 and arm/v7 (raspberry pi).
Haven't tested on arm64.
reconcilers-dev
.