-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Alpine compatibility #194
base: main
Are you sure you want to change the base?
Conversation
@nil-malh Build is currently failing for Windows and MacOS. I think it is related to Args are already defined in GitHub Actions: Do we need to have them in the |
@nil-malh Note that starting from Alpine v3.13, after installing /test # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.13.12
PRETTY_NAME="Alpine Linux v3.13"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
/test # ./kafkactl-1.14.0-linux-amd64 -V
Version 1.14.0 |
Absolutely it was some leftovers from my testing on my machine I'll remove it from the build.gradle :). |
Thanks for bringing this up ! I was unaware of gcompat thanks !
What do you want to do going forward ? |
@nil-malh It’s always better if the CLI works out of the box without additional installation. However I need to do some tests and answer the following questions:
|
On the latest version of Kafkactl at date 0.14.0 : non musl-c : 87mb with muslc : 87.35mb
AFAIK, I am currently using a static build of Kafkactl inside my Ubuntu WSL and I don't have any issues at all ! |
I've tested static linking to Musl on latest Alpine, latest Debian, latest Ubuntu, Ubuntu 22.04 LTS and Ubuntu 20.04 LTS. Looks good. I've open #203 to guide you through my following suggestions:
I think we can keep providing a single Kafkactl, statically linked to Musl. Some other apps are doing this as well which confirms my decision. 👉 I let you do a first update of your PR @ThomasCAI-mlv We might need to discuss about moving to Alpine: Line 89 in 71582bb
|
Alpine Compatibility: Static Linking with musl libc
Issue
When running the kafkactl native-image in Alpine Docker containers, it produces segmentation faults due to symbol incompatibilities between glibc and musl:
Solution
This PR modifies our build process to create statically linked binaries with musl libc for Linux builds. This allows our application to run correctly in Alpine and other musl-based environments.
Specifically:
--static --libc=musl
options with GraalVM's native-image--gcc-toolchain=/usr/local/musl/x86_64-linux-musl-native
Changes
Testing
The changes have been tested by building the application and running it in an Alpine container to verify that the segmentation faults no longer occur.
References