You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the postgres alpine images are quite large.
postgres 13.9-alpine 8e750948d39a 4 weeks ago 238MB
A big part is caused by liblvm15
/ # ls -lh /usr/lib/libLLVM-15.*
lrwxrwxrwx 1 root root 13 Jan 9 19:27 /usr/lib/libLLVM-15.0.6.so -> libLLVM-15.so
-rwxr-xr-x 1 root root 125.3M Nov 29 20:09 /usr/lib/libLLVM-15.so
This is part of .postgresql-rundeps, as postgres is compiled with the --with-llvm option, even for the alpine build flavor. (In order to support JIT)
Given that alpine docker builds are supposed to use little disk space you might wonder if that is desired.
Suggestion: Build postgres alpine build without the --with-llvm option, to get lean 'alpine' postgres images.
Or alternatively some trickery in the runDeps might be appropriate. I noticed that the postgres Dockerfile already filters out manually the python/perl/tcl dependencies. That could be extended for liblvm.
--- a/Dockerfile
+++ b/Dockerfile
@@ -120,6 +120,9 @@ RUN set -eux; \
# Remove plperl, plpython and pltcl dependencies by default to save image size
# To use the pl extensions, those have to be installed in a derived image
| grep -v -e perl -e python -e tcl \
+# Remove libLVM (required for JIT) dependency by default to save image size
+# To use the jit features, this library has to be installed in a derived image
+ | grep -v -e LLVM \
)"; \
apk add --no-cache --virtual .postgresql-rundeps \
$runDeps \
We discussed the size trade-off in #475, but the conclusion is that PostgreSQL actively recommends having this functionality enabled and actively using it for large queries. Our goal is to follow upstream as closely as possible, so we opted to follow suit even on Alpine where it's (unfortunately) a significant size increase. 😞
Not sure I agree with the trade-off that was made. 130MB is pretty significant. For a feature that has limited benefits (JIT).
But anyway, thats how it is....
I guess this ticket can be closed then.
Is there such a thing as an alpine-slim flavour?
I'm in favour for that :)
I noticed that the postgres alpine images are quite large.
postgres 13.9-alpine 8e750948d39a 4 weeks ago 238MB
A big part is caused by liblvm15
This is part of .postgresql-rundeps, as postgres is compiled with the --with-llvm option, even for the alpine build flavor. (In order to support JIT)
Given that alpine docker builds are supposed to use little disk space you might wonder if that is desired.
Suggestion: Build postgres alpine build without the --with-llvm option, to get lean 'alpine' postgres images.
Or alternatively some trickery in the runDeps might be appropriate. I noticed that the postgres Dockerfile already filters out manually the python/perl/tcl dependencies. That could be extended for liblvm.
Something like this:
(Dockerfile)
result
The text was updated successfully, but these errors were encountered: