-
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
[improve] Removed unnecessary native libraries from Docker images #22230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just had a question about musl&glibc coexistence
docker/pulsar/build-scripts/remove-unnecessary-native-binaries.sh
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea
error message in failing containers
|
docker/pulsar/build-scripts/remove-unnecessary-native-binaries.sh
Outdated
Show resolved
Hide resolved
docker/pulsar/build-scripts/remove-unnecessary-native-binaries.sh
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #22230 +/- ##
============================================
+ Coverage 73.57% 73.58% +0.01%
+ Complexity 32624 32259 -365
============================================
Files 1877 1879 +2
Lines 139502 139792 +290
Branches 15299 15338 +39
============================================
+ Hits 102638 102872 +234
- Misses 28908 28926 +18
- Partials 7956 7994 +38
Flags with carried forward coverage won't be shown. Click here to find out more. |
Motivation
The RocksDB jar that we are including in our Docker image is ~55 MB in size because it includes native library of RocksDB compiled for many different platforms.
In reality, our Docker image is going to be used exactly on one single platorm, either
linux/x86-64
orlinux/arm64
.Therefore we can remove all the other RocksDB compiled libraries from the image. The resulting RocksDB jar is shrunk to 4.6 MB.
Similarly, we can remove Netty TC natives jar that are not relevant for the container.
Modifications
Added a script to remove the unnecessary libraries.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: