-
Notifications
You must be signed in to change notification settings - Fork 381
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
Make tarball target work with arm64 cross-compilation and simplify Makefile/Dockerfile #1805
Conversation
This removes the tetragon-image target that was just an alias to doing `make tetragon tetra` and also removes the cross-compiler part since tetragon no longer use CGO to compile. Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @mtardy thank you for handling this. I tested it , make tarball then make TARGET_ARCH=arm64 tarbal, it fails with:
So it needs arm emulation here, if there is no easy way and it is complicated, then would it be possible at the last stage of copying the binaries make targetplatform same as buildplatform? so we run in amd64 context and we copy binaries from other arm64 builds? Also we can add an environment variable TARBALL_CROSS_COMPILE , so if set we use the above where targetplatform becomes buildplatform as the aim is to just have the arm binaries copied into the final one layer image. We don't want to run that image... just use it to dump into tarball. If TARBALL_CROSS_COMPILE is not set then no change current solution is perfect. |
You just need to install qemu-user-static on your amd64 machine. You need emulation for a tiny fraction of the steps just to execute some Docker RUN operation for the last stages of the Dockerfile. Qemu is part of a functional Docker install with buildx to build multi-arch images, see details here https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/. |
Thank you Mahé, yes it seems the arm emulation got better, it used to fail past years due to some complex instructions... anyway just tested tetra arm64 it works, didn't test daemon. Could you please test the generated tarball? and as a later step I will add a ci job for it. Feel free to merge ;-) |
I tested it manually on my arm64 VM and it worked fine. Thanks let's merge this. |
I tested on my amd64 VM and it generated the correct binaries for each architecture with cross-compilation. Can you check as well that it works for you with: