From 017d3a390dd17313612d23eb7d757635d42f6365 Mon Sep 17 00:00:00 2001 From: Vadim Kharitonov Date: Fri, 14 Apr 2023 14:00:13 +0300 Subject: [PATCH] Compile postgres with lz4 and zstd support --- Dockerfile.compute-node | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile.compute-node b/Dockerfile.compute-node index 742f2e18a1..2b1d8d63ae 100644 --- a/Dockerfile.compute-node +++ b/Dockerfile.compute-node @@ -12,7 +12,7 @@ FROM debian:bullseye-slim AS build-deps RUN apt update && \ apt install -y git autoconf automake libtool build-essential bison flex libreadline-dev \ zlib1g-dev libxml2-dev libcurl4-openssl-dev libossp-uuid-dev wget pkg-config libssl-dev \ - libicu-dev libxslt1-dev + libicu-dev libxslt1-dev liblz4-dev libzstd-dev ######################################################################################### # @@ -24,8 +24,13 @@ FROM build-deps AS pg-build ARG PG_VERSION COPY vendor/postgres-${PG_VERSION} postgres RUN cd postgres && \ - ./configure CFLAGS='-O2 -g3' --enable-debug --with-openssl --with-uuid=ossp --with-icu \ - --with-libxml --with-libxslt && \ + export CONFIGURE_CMD="./configure CFLAGS='-O2 -g3' --enable-debug --with-openssl --with-uuid=ossp \ + --with-icu --with-libxml --with-libxslt --with-lz4" && \ + if [ "${PG_VERSION}" != "v14" ]; then \ + # zstd is available only from PG15 + export CONFIGURE_CMD="${CONFIGURE_CMD} --with-zstd"; \ + fi && \ + eval $CONFIGURE_CMD && \ make MAKELEVEL=0 -j $(getconf _NPROCESSORS_ONLN) -s install && \ make MAKELEVEL=0 -j $(getconf _NPROCESSORS_ONLN) -s -C contrib/ install && \ # Install headers @@ -565,13 +570,17 @@ COPY --from=compute-tools --chown=postgres /home/nonroot/target/release-line-deb # Install: # libreadline8 for psql # libicu67, locales for collations (including ICU and plpgsql_check) +# liblz4-1 for lz4 # libossp-uuid16 for extension ossp-uuid # libgeos, libgdal, libsfcgal1, libproj and libprotobuf-c1 for PostGIS # libxml2, libxslt1.1 for xml2 +# libzstd1 for zstd RUN apt update && \ apt install --no-install-recommends -y \ + gdb \ locales \ libicu67 \ + liblz4-1 \ libreadline8 \ libossp-uuid16 \ libgeos-c1v5 \ @@ -581,7 +590,7 @@ RUN apt update && \ libsfcgal1 \ libxml2 \ libxslt1.1 \ - gdb && \ + libzstd1 && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8