diff --git a/Dockerfile b/Dockerfile index 3e93b7fc3e3698037c9f2f89ed5633c94883538e..1ba6a8e6bcd9cdd75ad697d4e08eadfbf9334937 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ FROM registry.conarx.tech/containers/postgresql/3.18 as tsbuilder-base -ENV POSTGRESQL_VER=15.2 +ENV POSTGRESQL_VER=15.4 # Copy build patches COPY patches build/patches @@ -55,6 +55,62 @@ RUN set -eux; \ +FROM tsbuilder-base as tsbuilder-2.11.2 + +ENV TIMESCALEDB_VER=2.11.2 + +# Checkout the right version +RUN set -eux; \ + cd build; \ + cd timescaledb; \ + git checkout "$TIMESCALEDB_VER" + +# Build +RUN set -eux; \ + cd build; \ + cd "timescaledb"; \ +# Patching + # TODO: Patch can maybe be removed in future? 2.10.0+ + patch -p1 < ../patches/disable-partialize_finalize-test.patch; \ + patch -p1 < ../patches/timescaledb-2.9.3_disable-pg_join-test.patch; \ + mkdir build; \ + cd build; \ + \ + cmake ..; \ + make VERBOSE=1 -j$(nproc) -l 8; \ + make DESTDIR="/build/timescaledb-root" install; \ + # We need to install a second time to run timescaledb tests + echo "Size before stripping..."; \ + du -hs /build/timescaledb-root + +# Strip binaries +RUN set -eux; \ + cd build/timescaledb-root; \ + scanelf --recursive --nobanner --osabi --etype "ET_DYN,ET_EXEC" . | awk '{print $3}' | xargs \ + strip \ + --remove-section=.comment \ + --remove-section=.note \ + -R .gnu.lto_* -R .gnu.debuglto_* \ + -N __gnu_lto_slim -N __gnu_lto_v1 \ + --strip-unneeded; \ + echo "Size after stripping..."; \ + du -hs /build/timescaledb-root + +# Testing +RUN set -eux; \ + # Install TimescaleDB so we can run the installcheck tests below + tar -c -C /build/timescaledb-root . | tar -x -C /; \ + # For testing we need to run the tests as a non-priv user + cd build; \ + adduser -D pgsqltest; \ + chown -R pgsqltest:pgsqltest "timescaledb"; \ + cd "timescaledb"; \ + cd build; \ + # Test + sudo -u pgsqltest make VERBOSE=1 -j1 -l8 installcheck + + + FROM tsbuilder-base as tsbuilder-2.11.1 ENV TIMESCALEDB_VER=2.11.1 @@ -290,6 +346,7 @@ COPY --from=tsbuilder-2.9.2 /build/timescaledb-root / COPY --from=tsbuilder-2.9.3 /build/timescaledb-root / COPY --from=tsbuilder-2.10.1 /build/timescaledb-root / COPY --from=tsbuilder-2.11.1 /build/timescaledb-root / +COPY --from=tsbuilder-2.11.2 /build/timescaledb-root / ARG VERSION_INFO=