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

Use tonistiigi/xx for cross-platform builds #335

Merged
merged 4 commits into from
Oct 14, 2021
Merged

Conversation

darkowlzz
Copy link
Contributor

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 7 minutes on my
machine. Cross-compiling reduces the multi-arch build to under 3
minutes.
Manually tested the built image on amd64 and arm/v7 (raspberry pi).
Haven't tested on arm64.

.github/workflows/e2e.yaml Outdated Show resolved Hide resolved
@darkowlzz darkowlzz marked this pull request as ready for review October 12, 2021 21:29
@darkowlzz darkowlzz force-pushed the xx-builds branch 3 times, most recently from 03ee15b to 0174b31 Compare October 13, 2021 15:33
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Given the further addressing of the workflows will be handled in a separate PR, this looks sufficient for me to speed up the build time by a lot for now.

Thanks @darkowlzz 🙇 🥇

Update the Dockerfile to use tonistiigi/xx to cross-compile the
manager binaries natively and speed up the multi-arch image build
time.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
e2e:
- Enable buildx.
- Build only for linux/amd64.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Prevent running the tests twice in e2e workflow by removing the
dependency on docker-build on test.
Update e2e workflow to remove setting KUBEBUILDER_ASSETS needed to run
tests from "Build container image" step.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
@darkowlzz
Copy link
Contributor Author

Rebased.

@hiddeco hiddeco added the area/ci CI related issues and pull requests label Oct 14, 2021
@hiddeco hiddeco merged commit e89fded into fluxcd:main Oct 14, 2021
@darkowlzz darkowlzz deleted the xx-builds branch October 14, 2021 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci CI related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants