-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix] Switch docker base image to avoid mixing musl & glibc libraries at runtime #23366
base: master
Are you sure you want to change the base?
[fix] Switch docker base image to avoid mixing musl & glibc libraries at runtime #23366
Conversation
It looks like test image building fails due to missing supervisor package. It is available also with pip install: http://supervisord.org/installing.html |
… at runtime Mixing musl & glibc libraries at runtime will result in compatibility issues. We need a solution with real glibc because of compatibility reasons. The previous solution with the Alpine base image has a critical issue since it mixes musl compiled and glibc compiled libraries at runtime while using real glibc. This is why the switch is needed. For example, snappy-java and Conscrypt show that this problem occurs.
Co-authored-by: Zixuan Liu <[email protected]>
8cc60d3
to
a42afb9
Compare
supervisor has been installed, but there is some remaining issue. |
Unrecognized option: -client Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23366 +/- ##
============================================
+ Coverage 73.57% 74.57% +0.99%
- Complexity 32624 33962 +1338
============================================
Files 1877 1934 +57
Lines 139502 145132 +5630
Branches 15299 15870 +571
============================================
+ Hits 102638 108231 +5593
+ Misses 28908 28604 -304
- Partials 7956 8297 +341
Flags with carried forward coverage won't be shown. Click here to find out more. |
Motivation
While testing Pulsar 4.0.0-preview.1, some compatibility issues with the Alpine base image have shown up.
It appears that the solution in the base image is something that will cause further compatibility issues. Mixing musl and glibc at runtime is known to cause compatibility and stability issues.
sgerrand/alpine-pkg-glibc#194 (comment) mentions:
"You really need everything pure musl, or everything musl (but works with gcompat or libc6-compat shim-like tools...) or everything glibc using this package)"
In our case, we are mixing pure musl libraries and glibc compiled libraries with our Alpine base image configuration which should be avoided.
Another reason to switch to a base image that is optimized for running Java JVM applications. The current Alpine image crashes the JVM in unexpected ways. #23348/#23361 is an example of this.
Modifications
Use https://hub.docker.com/r/bellsoft/liberica-runtime-container as the base image. (Apache NiFi uses a bellsoft/liberica-openjdk-debian, so Liberica is already used in ASF.)
It's the Liberica OpenJDK's official base image provided by BellSoft. It uses Alpaquita Linux as the OS, which is similar to Alpine and uses
apk
as the package manager. Alpaquita Linux is optimized for running JVM applications.The image size is very similar as before.
Documentation
doc
doc-required
doc-not-needed
doc-complete