[fix] EXPERIMENT: Switch docker base image to avoid mixing musl & glibc libraries at runtime #23366
+24
−279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24647#note_176723 states it clearly:
"Combining glibc and musl runtimes is basically all but guaranteed to create an unstable environment, unless the system is appropriately configured (glibc side uses glibc binaries only, and vice versa)."
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.
There's also one more release blocker which could be due to the mixed musl & glibc environment: #23306
Why mixing musl & glibc at runtime should be avoided
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