diff --git a/postgres-appliance/Dockerfile b/postgres-appliance/Dockerfile index db702eec..ab19aa9e 100644 --- a/postgres-appliance/Dockerfile +++ b/postgres-appliance/Dockerfile @@ -1,5 +1,6 @@ ARG BASE_IMAGE=ubuntu:22.04 ARG PGVERSION=17 +ARG TIMESCALEDB="2.15.3 2.17.2" ARG DEMO=false ARG COMPRESS=false ARG ADDITIONAL_LOCALES= @@ -43,6 +44,7 @@ COPY build_scripts/base.sh /builddeps/ COPY --from=dependencies-builder /builddeps/*.deb /builddeps/ ARG PGVERSION +ARG TIMESCALEDB ARG TIMESCALEDB_APACHE_ONLY=true ARG TIMESCALEDB_TOOLKIT=true ARG COMPRESS diff --git a/postgres-appliance/build_scripts/base.sh b/postgres-appliance/build_scripts/base.sh index 201b0776..b7d10192 100644 --- a/postgres-appliance/build_scripts/base.sh +++ b/postgres-appliance/build_scripts/base.sh @@ -124,6 +124,19 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do "postgresql-${version}-pg-stat-kcache" \ "${EXTRAS[@]}" + # Clean up timescaledb versions except the highest compatible version + exclude_patterns=() + exclude_patterns_tsl=() + for ts_version in ${TIMESCALEDB}; do + exclude_patterns+=(! -name timescaledb-"${ts_version}".so) + exclude_patterns_tsl+=(! -name timescaledb-tsl-"${ts_version}".so) + done + find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-2.*.so' "${exclude_patterns[@]}" -delete; + + if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ]; then + find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-tsl-2.*.so' "${exclude_patterns_tsl[@]}" -delete; + fi + # Install 3rd party stuff if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then