From c76d7958f85945604a8f405fd00ae4b330c6badb Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 13 Sep 2022 16:49:42 +0000 Subject: [PATCH 01/22] PostgreSQL 15 support --- README.md | 17 ++++++- extended-postgres/Dockerfile | 73 +++++++++++++++++---------- extended-postgres/build-images-ci.yml | 16 ++++++ 3 files changed, 78 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index a90f85a..65d9ade 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Storage-optimized: the size of each image is ~300-500 MiB. Use these images with Database Lab, when you need HypoPG or anything else. ### What's inside -Available PostgreSQL versions: 9.6, 10, 11, 12, 13, 14. Extensions: +Available PostgreSQL versions: 9.6 (EOL), 10, 11, 12, 13, 14, 15. Extensions: - all official ["core" contrib modules](https://www.postgresql.org/docs/current/contrib.html) - [bg_mon](https://github.com/CyberDem0n/bg_mon) - [Citus](https://github.com/citusdata/citus) @@ -33,6 +33,21 @@ Available PostgreSQL versions: 9.6, 10, 11, 12, 13, 14. Extensions: - [set_user](https://github.com/pgaudit/set_user) - [Timescale](https://github.com/timescale/timescaledb) +#### Not included in the PostgreSQL 15 image (yet) +The PostgreSQL 15 image is now missing the following extensions (they will be added in the future): +- pg_repack +- pgaudit +- pg_auth_mon +- pg_hint_plan +- timescaledb +- citus +- hll +- topn +- pg_cron +- pg_show_plans +- pg_wait_sampling +- bg_mon + #### Not included in the PostgreSQL 14 image (yet) The PostgreSQL 14 image is now missing the following extensions (they will be added in the future): - pg_auth_mon diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 9d33637..9ddf5e4 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -38,12 +38,14 @@ ARG PG_SERVER_VERSION ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14} ARG PGBR_VERSION -ENV PGBR_VERSION=${PGBR_VERSION:-2.39} +ENV PGBR_VERSION=${PGBR_VERSION:-2.40} ARG PG_TIMETABLE_VERSION -ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.8.0} +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.9.0} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ + # remove the "beta" suffix in the PG_SERVER_VERSION variable (if exists) + && PG_SERVER_VERSION="$( echo ${PG_SERVER_VERSION} | sed 's/beta.*//' )" \ # add the backports repository for Debian 9 Stretch. Required to install the package "libbrotli-dev" && if [ $(sed 's/\..*//' /etc/debian_version) = "9" ]; then \ echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list; \ @@ -63,15 +65,19 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ postgresql-9.6-amcheck; \ fi \ # pg_repack extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-repack \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-repack; \ + fi \ # hypopg extension && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-hypopg \ postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \ # pgaudit extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pgaudit \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pgaudit; \ + fi \ # pg_hint_plan extension && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ @@ -112,41 +118,54 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get install --no-install-recommends -y \ timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ fi \ - # citus extension; the latest versions only support Postgres 13+ - && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then CITUS_VERSION="8.0"; \ - elif [ "${PG_SERVER_VERSION}" = "10" ]; then CITUS_VERSION="8.3"; \ - elif [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ - elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ - elif [ $(echo "$PG_SERVER_VERSION > 12" | /usr/bin/bc) = "1" ]; then CITUS_VERSION="11.0"; \ + # citus extension + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + if [ "${PG_SERVER_VERSION}" = "9.6" ]; then CITUS_VERSION="8.0"; \ + elif [ "${PG_SERVER_VERSION}" = "10" ]; then CITUS_VERSION="8.3"; \ + elif [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ + elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ + elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.0"; \ + elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="11.0"; \ + fi \ + && curl -s https://install.citusdata.com/community/deb.sh | bash \ + && apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ fi \ - && curl -s https://install.citusdata.com/community/deb.sh | bash \ - && apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}" \ # hll extension - && apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-hll \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-hll; \ + fi \ # topn extension - && apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-topn \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-topn;\ + fi \ # pg_timetable extension && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v${PG_TIMETABLE_VERSION}/pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ && dpkg -i pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ && rm -rf pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ # pg_show_plans extension - && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ - && cd pg_show_plans \ - && export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ + && cd pg_show_plans \ + && export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans; \ + fi \ # pg_cron extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-cron \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-cron; \ + fi \ # postgresql_anonymizer extension && pgxn install ddlx && pgxn install postgresql_anonymizer \ # pg_stat_kcache extension && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ + && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \ + fi \ # pg_qualstats extension && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-pg-qualstats \ @@ -188,7 +207,7 @@ EXPOSE 5432 RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \ && echo "chown -R postgres:postgres \${PGDATA} /var/run/postgresql" \ >> /pg_start.sh \ - && printf "sudo -Eu postgres /usr/lib/postgresql/${PG_SERVER_VERSION}/bin/postgres -D \${PGDATA} >& /proc/1/fd/1 \n" \ + && printf "sudo -Eu postgres /usr/lib/postgresql/$( echo ${PG_SERVER_VERSION} | sed 's/beta.*//' )/bin/postgres -D \${PGDATA} >& /proc/1/fd/1 \n" \ >> /pg_start.sh \ # Infinite sleep to allow restarting Postgres && echo "/bin/bash -c \"trap : TERM INT; sleep infinity & wait\"" \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index aea9dd5..99ce796 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -94,6 +94,14 @@ build-extended-postgres-14-image-latest: PG_SERVER_VERSION: "14" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" +build-extended-postgres-15-image-latest: + <<: *build_image_definition_dh + <<: *only_tag_release + variables: + <<: *extended_image_vars_dh + PG_SERVER_VERSION: "15beta4" + TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" + build-extended-postgres-9-6-image-feature: <<: *build_image_definition_gl <<: *only_feature @@ -141,3 +149,11 @@ build-extended-postgres-14-image-feature: <<: *extended_image_vars_gl PG_SERVER_VERSION: "14" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" + +build-extended-postgres-15-image-feature: + <<: *build_image_definition_gl + <<: *only_feature + variables: + <<: *extended_image_vars_gl + PG_SERVER_VERSION: "15beta4" + TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From 1b4ddc3fa75d27928b983042bb8184ad4fe6c686 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Wed, 14 Sep 2022 01:30:26 +0300 Subject: [PATCH 02/22] build logerrors extension from the master branch for PostgreSQL 15 --- extended-postgres/Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 9ddf5e4..0f53c2b 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -181,10 +181,18 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \ # logerrors extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \ - && tar -xf v2.0.tar.gz && rm v2.0.tar.gz && cd logerrors-2.0 \ - && USE_PGXS=1 make && USE_PGXS=1 make install; \ - fi \ + # build logerrors v2.0 + if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \ + && tar -xf v2.0.tar.gz && rm v2.0.tar.gz && cd logerrors-2.0 \ + && USE_PGXS=1 make && USE_PGXS=1 make install; \ + # build logerrors from the master branch for PostgreSQL 15 + elif [ "${PG_SERVER_VERSION}" = "15" ]; then \ + cd /tmp && git clone https://github.com/munakoiso/logerrors.git \ + && cd logerrors \ + && USE_PGXS=1 make && USE_PGXS=1 make install; \ + fi \ + fi \ # pgBackRest && apt-get install --no-install-recommends -y \ pgbackrest=${PGBR_VERSION}* zstd openssh-client \ From 744af7b9155ad8fdab0347e27c475686f10d676a Mon Sep 17 00:00:00 2001 From: Artyom Kartasov Date: Fri, 16 Sep 2022 02:23:12 +0000 Subject: [PATCH 03/22] fix: install pgaudit-1.17beta1 for PostgreSQL 15 (#15) --- extended-postgres/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 0f53c2b..5047583 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -77,6 +77,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-pgaudit; \ + # build pgaudit from the 1.7beta1 for PostgreSQL 15 + elif [ "${PG_SERVER_VERSION}" = "15" ]; then \ + cd /tmp && git clone https://github.com/pgaudit/pgaudit.git \ + && cd pgaudit \ + && git checkout 1.7beta1 \ + && make install USE_PGXS=1 PG_CONFIG=/usr/bin/pg_config; \ fi \ # pg_hint_plan extension && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ From 8013952ad9a9673655db20713888424044fe60aa Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 4 Oct 2022 20:52:27 +0000 Subject: [PATCH 04/22] Update image for PosrgreSQL 15 from "15beta4" to "15rc1" --- extended-postgres/Dockerfile | 11 ++++------- extended-postgres/build-images-ci.yml | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 5047583..82ac9dc 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -37,15 +37,12 @@ COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g ARG PG_SERVER_VERSION ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14} -ARG PGBR_VERSION -ENV PGBR_VERSION=${PGBR_VERSION:-2.40} - ARG PG_TIMETABLE_VERSION ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.9.0} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ - # remove the "beta" suffix in the PG_SERVER_VERSION variable (if exists) - && PG_SERVER_VERSION="$( echo ${PG_SERVER_VERSION} | sed 's/beta.*//' )" \ + # remove the "beta" and "rc" suffix in the PG_SERVER_VERSION variable (if exists) + && PG_SERVER_VERSION="$( echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//' )" \ # add the backports repository for Debian 9 Stretch. Required to install the package "libbrotli-dev" && if [ $(sed 's/\..*//' /etc/debian_version) = "9" ]; then \ echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list; \ @@ -201,7 +198,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ fi \ # pgBackRest && apt-get install --no-install-recommends -y \ - pgbackrest=${PGBR_VERSION}* zstd openssh-client \ + pgbackrest zstd openssh-client \ && mkdir -p -m 700 /var/lib/postgresql/.ssh \ && chown postgres:postgres /var/lib/postgresql/.ssh \ # remove all auxilary packages to reduce final image size @@ -221,7 +218,7 @@ EXPOSE 5432 RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \ && echo "chown -R postgres:postgres \${PGDATA} /var/run/postgresql" \ >> /pg_start.sh \ - && printf "sudo -Eu postgres /usr/lib/postgresql/$( echo ${PG_SERVER_VERSION} | sed 's/beta.*//' )/bin/postgres -D \${PGDATA} >& /proc/1/fd/1 \n" \ + && printf "sudo -Eu postgres /usr/lib/postgresql/$(echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//')/bin/postgres -D \${PGDATA} >& /proc/1/fd/1 \n" \ >> /pg_start.sh \ # Infinite sleep to allow restarting Postgres && echo "/bin/bash -c \"trap : TERM INT; sleep infinity & wait\"" \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index 99ce796..96196da 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -155,5 +155,5 @@ build-extended-postgres-15-image-feature: <<: *only_feature variables: <<: *extended_image_vars_gl - PG_SERVER_VERSION: "15beta4" + PG_SERVER_VERSION: "15rc1" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From 2246504b8f7912341851eb8d4d07cc3d60c83744 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 4 Oct 2022 21:37:19 +0000 Subject: [PATCH 05/22] set PG_SERVER_VERSION: "15rc1" for build-extended-postgres-15-image-latest --- extended-postgres/build-images-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index 96196da..f21289d 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -99,7 +99,7 @@ build-extended-postgres-15-image-latest: <<: *only_tag_release variables: <<: *extended_image_vars_dh - PG_SERVER_VERSION: "15beta4" + PG_SERVER_VERSION: "15rc1" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" build-extended-postgres-9-6-image-feature: From 7a1266ae285b171ba3ad9c7094198cf7c6090e24 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 10 Oct 2022 22:04:45 +0000 Subject: [PATCH 06/22] Use the Postgres image based on Debian 11 (bullseye) for extended-postgres --- README.md | 12 +++----- extended-postgres/Dockerfile | 56 +++++++++++++----------------------- 2 files changed, 24 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 65d9ade..f050545 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,8 @@ The PostgreSQL 15 image is now missing the following extensions (they will be ad - pg_auth_mon - pg_hint_plan - timescaledb -- citus -- hll -- topn - pg_cron - pg_show_plans -- pg_wait_sampling - bg_mon #### Not included in the PostgreSQL 14 image (yet) @@ -67,7 +63,7 @@ The PostgreSQL 14 image is now missing the following extensions (they will be ad | btree_gin | 1.0 | 1.2 | 1.3 | 1.3 | 1.3 | 1.3 | support for indexing common datatypes in GIN | | btree_gist | 1.2 | 1.5 | 1.5 | 1.5 | 1.5 | 1.6 | support for indexing common datatypes in GiST | | citext | 1.3 | 1.4 | 1.5 | 1.6 | 1.6 | 1.6 | data type for case-insensitive character strings | -| citus | 8.0 | 8.3 | 10.0 | 10.2 | 11.0 | 11.0 | Citus distributed database | +| citus | | | 10.0 | 10.2 | 11.1 | 11.1 | Citus distributed database | | cube | 1.2 | 1.2 | 1.4 | 1.4 | 1.4 | 1.5 | data type for multidimensional cubes | | dblink | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | connect to other PostgreSQL databases from within a database | | ddlx | 0.22 | 0.22 | 0.22 | 0.22 | 0.22 | 0.22 | DDL eXtractor functions | @@ -76,7 +72,7 @@ The PostgreSQL 14 image is now missing the following extensions (they will be ad | earthdistance | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | calculate great-circle distances on the surface of the Earth | | file_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | foreign-data wrapper for flat file access | | fuzzystrmatch | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | determine similarities and distance between strings | -| hll | 2.16 | 2.1 | 2.16 | 2.16 | 2.16 | 2.16 | type for storing hyperloglog data | +| hll | 2.16 | 2.17 | 2.17 | 2.17 | 2.17 | 2.17 | type for storing hyperloglog data | | hstore | 1.4 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | data type for storing sets of (key, value) pairs | | hstore_plpython3u | 1.0 | 1.0 | 1.0 | 1 .0 | 1.0 | 1.0 | transform between hstore and plpython3u | | hypopg | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | Hypothetical indexes for PostgreSQL | @@ -121,9 +117,9 @@ The PostgreSQL 14 image is now missing the following extensions (they will be ad | sslinfo | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | information about SSL certificates | | tablefunc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions that manipulate whole tables, including crosstab | | tcn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | Triggered change notifications | -| timescaledb | 1.7.5 | 1.7.5 | 2.3.1 | 2.7.1 | 2.7.1 | 2.7.1 | Enables scalable inserts and complex queries for time-series data | +| timescaledb | | | | 2.8.1 | 2.8.1 | 2.8.1 | Enables scalable inserts and complex queries for time-series data | | timetravel | 1.0 | 1.0 | 1.0 | | | | functions for implementing time travel | -| topn | 2.3.0 | 2.3.0 | 2.4.0 | 2.4.0 | 2.4.0 | 2.4.0 | type for top-n JSONB | +| topn | | 2.5.0 | 2.5.0 | 2.5.0 | 2.5.0 | 2.5.0 | type for top-n JSONB | | tsm_system_rows | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | TABLESAMPLE method which accepts number of rows as a limit | | tsm_system_time | 1.0 | 1.0 | 1.0 | 1.0 | 11.0 | 1.0 | TABLESAMPLE method which accepts time in milliseconds as a limit | | unaccent | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | text search dictionary that removes accents | diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 82ac9dc..a155520 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -1,7 +1,11 @@ +# Debian 11 (bullseye) has glibc 2.31. +# If you are using "physical" mode, please check the glibc version in your production database system to avoid potential index corruption. +# You should have the same version of glibc as in your Docker image. + ARG PG_SERVER_VERSION=14 # build-env -FROM postgres:${PG_SERVER_VERSION} as build-env +FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env ARG WALG_VERSION ENV WALG_VERSION=${WALG_VERSION:-2.0.0} @@ -10,10 +14,6 @@ ARG GO_VERSION ENV GO_VERSION=${GO_VERSION:-1.18.4} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ - # add the backports repository for Debian 9 Stretch. Required to install the package "libbrotli-dev" - && if [ $(sed 's/\..*//' /etc/debian_version) = "9" ]; then \ - echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list; \ - fi \ # install dependencies && apt-get update -o Acquire::CompressionTypes::Order::=gz \ && apt-get install --no-install-recommends -y apt-transport-https ca-certificates \ @@ -29,7 +29,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && make deps && GOBIN=/usr/local/bin make pg_install # Build the extended image -FROM postgres:${PG_SERVER_VERSION} +FROM postgres:${PG_SERVER_VERSION}-bullseye LABEL maintainer="postgres.ai" COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g @@ -43,10 +43,6 @@ ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.9.0} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # remove the "beta" and "rc" suffix in the PG_SERVER_VERSION variable (if exists) && PG_SERVER_VERSION="$( echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//' )" \ - # add the backports repository for Debian 9 Stretch. Required to install the package "libbrotli-dev" - && if [ $(sed 's/\..*//' /etc/debian_version) = "9" ]; then \ - echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list; \ - fi \ && apt-get update -o Acquire::CompressionTypes::Order::=gz \ && apt-get install --no-install-recommends -y wget make gcc unzip sudo git \ curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \ @@ -106,15 +102,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ fi \ # timescaledb extension - && if [ $(echo "$PG_SERVER_VERSION < 11" | /usr/bin/bc) = "1" ]; then \ - echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \ - $(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}') \ - 'main' > /etc/apt/sources.list.d/timescaledb.list \ - && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ - && apt-get update \ - && apt-get install --no-install-recommends -y \ - timescaledb-postgresql-${PG_SERVER_VERSION}; \ - elif [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ @@ -122,27 +110,25 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ fi \ # citus extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - if [ "${PG_SERVER_VERSION}" = "9.6" ]; then CITUS_VERSION="8.0"; \ - elif [ "${PG_SERVER_VERSION}" = "10" ]; then CITUS_VERSION="8.3"; \ - elif [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ + && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ + if [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ - elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.0"; \ - elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="11.0"; \ + elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.1"; \ + elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="11.1"; \ + elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="11.1"; \ fi \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install --no-install-recommends -y \ postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ fi \ # hll extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-hll; \ - fi \ + && apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-hll \ # topn extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-topn;\ + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ + curl -s https://install.citusdata.com/community/deb.sh | bash \ + && apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-topn; \ fi \ # pg_timetable extension && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v${PG_TIMETABLE_VERSION}/pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ @@ -165,10 +151,8 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \ - fi \ + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ # pg_qualstats extension && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-pg-qualstats \ From 56884a1d83708835dc2d92f8b4e40eabb5ab18bf Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 18 Oct 2022 20:30:28 +0000 Subject: [PATCH 07/22] add PostgreSQL 15 (release) --- README.md | 2 -- extended-postgres/Dockerfile | 12 ++---------- extended-postgres/build-images-ci.yml | 4 ++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f050545..5a3719e 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,11 @@ Available PostgreSQL versions: 9.6 (EOL), 10, 11, 12, 13, 14, 15. Extensions: #### Not included in the PostgreSQL 15 image (yet) The PostgreSQL 15 image is now missing the following extensions (they will be added in the future): - pg_repack -- pgaudit - pg_auth_mon - pg_hint_plan - timescaledb - pg_cron - pg_show_plans -- bg_mon #### Not included in the PostgreSQL 14 image (yet) The PostgreSQL 14 image is now missing the following extensions (they will be added in the future): diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index a155520..62d6ce4 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -67,16 +67,8 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ postgresql-${PG_SERVER_VERSION}-hypopg \ postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \ # pgaudit extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pgaudit; \ - # build pgaudit from the 1.7beta1 for PostgreSQL 15 - elif [ "${PG_SERVER_VERSION}" = "15" ]; then \ - cd /tmp && git clone https://github.com/pgaudit/pgaudit.git \ - && cd pgaudit \ - && git checkout 1.7beta1 \ - && make install USE_PGXS=1 PG_CONFIG=/usr/bin/pg_config; \ - fi \ + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pgaudit \ # pg_hint_plan extension && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index f21289d..fa2573e 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -99,7 +99,7 @@ build-extended-postgres-15-image-latest: <<: *only_tag_release variables: <<: *extended_image_vars_dh - PG_SERVER_VERSION: "15rc1" + PG_SERVER_VERSION: "15" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" build-extended-postgres-9-6-image-feature: @@ -155,5 +155,5 @@ build-extended-postgres-15-image-feature: <<: *only_feature variables: <<: *extended_image_vars_gl - PG_SERVER_VERSION: "15rc1" + PG_SERVER_VERSION: "15" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From e10336354c06b0e5db2b2549dcb546f8d798ace2 Mon Sep 17 00:00:00 2001 From: Nikolay Samokhvalov Date: Wed, 19 Apr 2023 17:02:07 +0000 Subject: [PATCH 08/22] (DLE CE images) Full support of Postgres 15; add pgvector; multiple parts upgraded --- extended-postgres/Dockerfile | 148 +++++++++++++++-------------------- 1 file changed, 65 insertions(+), 83 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 62d6ce4..2f6b18c 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -2,16 +2,18 @@ # If you are using "physical" mode, please check the glibc version in your production database system to avoid potential index corruption. # You should have the same version of glibc as in your Docker image. -ARG PG_SERVER_VERSION=14 +ARG PG_SERVER_VERSION=15 # build-env FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env -ARG WALG_VERSION -ENV WALG_VERSION=${WALG_VERSION:-2.0.0} +ARG TARGETPLATFORM ARG GO_VERSION -ENV GO_VERSION=${GO_VERSION:-1.18.4} +ENV GO_VERSION=${GO_VERSION:-1.20.3} + +ARG WALG_VERSION +ENV WALG_VERSION=${WALG_VERSION:-2.0.1} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # install dependencies @@ -20,13 +22,15 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ wget curl sudo git make cmake gcc build-essential \ libbrotli-dev liblzo2-dev libsodium-dev \ # install Go - && cd /tmp && wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \ - && rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \ - && export PATH=$PATH:/usr/local/go/bin \ + && cd /tmp && GO_ARCH=$(if [ -z "${TARGETPLATFORM}" ]; then echo "amd64"; else echo ${TARGETPLATFORM} | cut -d '/' -f2; fi) \ + && export PATH=$PATH:/usr/local/go/bin && wget https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \ + && rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \ + && export PATH=$PATH:/usr/local/go/bin \ # build WAL-G - && git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git \ - && cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1 \ - && make deps && GOBIN=/usr/local/bin make pg_install + && cd /tmp && git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git \ + && cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1 \ + && make deps && GOBIN=/usr/local/bin make pg_install + # Build the extended image FROM postgres:${PG_SERVER_VERSION}-bullseye @@ -35,10 +39,16 @@ LABEL maintainer="postgres.ai" COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g ARG PG_SERVER_VERSION -ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14} +ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-15} ARG PG_TIMETABLE_VERSION -ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.9.0} +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.3.0} +ARG SET_USER_VERSION +ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1} +ARG LOGERRORS_VERSION +ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2} +ARG PGVECTOR_VERSION +ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.4.1} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # remove the "beta" and "rc" suffix in the PG_SERVER_VERSION variable (if exists) @@ -47,54 +57,35 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get install --no-install-recommends -y wget make gcc unzip sudo git \ curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \ build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \ - && apt-get install --no-install-recommends -y \ - postgresql-server-dev-${PG_SERVER_VERSION} \ + && apt-get install --no-install-recommends -y postgresql-server-dev-${PG_SERVER_VERSION} \ # plpython3 (procedural language implementation for Python 3.x) - && apt-get install --no-install-recommends -y \ - postgresql-plpython3-${PG_SERVER_VERSION} \ + && apt-get install --no-install-recommends -y postgresql-plpython3-${PG_SERVER_VERSION} \ # amcheck extension; not included in contrib for Postgres 9.6 && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-9.6-amcheck; \ + apt-get install --no-install-recommends -y postgresql-9.6-amcheck; \ fi \ # pg_repack extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-repack; \ - fi \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \ # hypopg extension && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-hypopg \ - postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \ + postgresql-${PG_SERVER_VERSION}-hypopg \ + postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \ # pgaudit extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pgaudit \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \ # pg_hint_plan extension - && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ - export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ - && wget --quiet -O /tmp/pg_hint_plan.zip \ - https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ - && unzip /tmp/pg_hint_plan.zip -d /tmp \ - && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \ - && make && make install; \ - # there is no branch "PG14", use the tag "REL14_1_4_0" - elif [ "${PG_SERVER_VERSION}" = "14" ]; then \ - wget --quiet -O /tmp/pg_hint_plan.zip \ - https://github.com/ossc-db/pg_hint_plan/archive/REL14_1_4_0.zip \ - && unzip /tmp/pg_hint_plan.zip -d /tmp \ - && cd /tmp/pg_hint_plan-REL14_1_4_0 \ - && make && make install; \ - fi \ + && export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ + && wget --quiet -O /tmp/pg_hint_plan.zip \ + https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ + && unzip /tmp/pg_hint_plan.zip -d /tmp \ + && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \ + && make && make install \ # powa extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-powa \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa \ # pg_auth_mon extension - && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ - git clone https://github.com/RafiaSabih/pg_auth_mon.git \ - && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ - fi \ + && cd /tmp && git clone https://github.com/RafiaSabih/pg_auth_mon.git \ + && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \ # timescaledb extension - && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ @@ -109,68 +100,59 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="11.1"; \ elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="11.1"; \ fi \ - && curl -s https://install.citusdata.com/community/deb.sh | bash \ - && apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ + && curl -s https://install.citusdata.com/community/deb.sh | bash \ + && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ fi \ # hll extension - && apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-hll \ + && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-hll \ # topn extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ curl -s https://install.citusdata.com/community/deb.sh | bash \ - && apt-get install --no-install-recommends -y \ - postgresql-"${PG_SERVER_VERSION}"-topn; \ + && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-topn; \ fi \ # pg_timetable extension && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v${PG_TIMETABLE_VERSION}/pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ && dpkg -i pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ && rm -rf pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ # pg_show_plans extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ && cd pg_show_plans \ - && export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans; \ + && export USE_PGXS=1 && make && make install; \ fi \ # pg_cron extension - && if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-cron; \ - fi \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron \ # postgresql_anonymizer extension && pgxn install ddlx && pgxn install postgresql_anonymizer \ # pg_stat_kcache extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ # pg_qualstats extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pg-qualstats \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \ # bg_mon extension && apt-get install -y libevent-dev libbrotli-dev \ && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ && USE_PGXS=1 make && USE_PGXS=1 make install && cd .. \ # pgextwlist extension - && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-pgextwlist \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \ # set_user extension && git clone https://github.com/pgaudit/set_user.git \ - && cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \ + && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install \ # logerrors extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ - # build logerrors v2.0 - if [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \ - && tar -xf v2.0.tar.gz && rm v2.0.tar.gz && cd logerrors-2.0 \ - && USE_PGXS=1 make && USE_PGXS=1 make install; \ - # build logerrors from the master branch for PostgreSQL 15 - elif [ "${PG_SERVER_VERSION}" = "15" ]; then \ - cd /tmp && git clone https://github.com/munakoiso/logerrors.git \ - && cd logerrors \ - && USE_PGXS=1 make && USE_PGXS=1 make install; \ - fi \ + cd /tmp && wget -O logerrors.tar.gz https://github.com/munakoiso/logerrors/archive/v${LOGERRORS_VERSION}.tar.gz \ + && tar -xf logerrors.tar.gz && rm logerrors.tar.gz && cd logerrors-${LOGERRORS_VERSION} \ + && USE_PGXS=1 make && USE_PGXS=1 make install; \ + fi \ + # pgvector extension + && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \ + && cd pgvector && make OPTFLAGS="" install \ + && mkdir /usr/share/doc/pgvector \ + && cp LICENSE README.md /usr/share/doc/pgvector \ + # it seems, v0.4.1 has incomplete setup process – we need to copy .sql manually + && cp sql/vector.sql /usr/share/postgresql/${PG_SERVER_VERSION}/extension/vector--${PGVECTOR_VERSION}.sql; \ fi \ # pgBackRest && apt-get install --no-install-recommends -y \ @@ -186,7 +168,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get clean -y autoclean \ && rm -rf /var/lib/apt/lists/* \ # remove standard pgdata - && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/ + && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/ EXPOSE 5432 From 500c61037a3076b0a710590a15a1a5f1c9ce11d1 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Thu, 25 May 2023 19:02:07 +0000 Subject: [PATCH 09/22] pg_auth_mon extension: Fix compatibility with PostgreSQL 9.6 --- extended-postgres/Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 2f6b18c..6479d6a 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -82,8 +82,15 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # powa extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa \ # pg_auth_mon extension - && cd /tmp && git clone https://github.com/RafiaSabih/pg_auth_mon.git \ - && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \ + && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ + cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ + && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ + elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v2.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ + && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ + fi \ + fi \ # timescaledb extension && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ @@ -132,12 +139,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \ # bg_mon extension && apt-get install -y libevent-dev libbrotli-dev \ - && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ + && cd /tmp && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ && USE_PGXS=1 make && USE_PGXS=1 make install && cd .. \ # pgextwlist extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \ # set_user extension - && git clone https://github.com/pgaudit/set_user.git \ + && cd /tmp && git clone https://github.com/pgaudit/set_user.git \ && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install \ # logerrors extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ From f2cd4342cbaf1f31a991eaee57619e18e1ab2860 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 5 Jun 2023 18:46:24 +0000 Subject: [PATCH 10/22] Downgrade the pg_cron version to 1.4 --- extended-postgres/Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 6479d6a..e378cc7 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -49,6 +49,9 @@ ARG LOGERRORS_VERSION ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2} ARG PGVECTOR_VERSION ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.4.1} +ARG PG_CRON_VERSION +ENV PG_CRON_VERSION=${PG_CRON_VERSION:-1.4.2} + RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # remove the "beta" and "rc" suffix in the PG_SERVER_VERSION variable (if exists) @@ -128,7 +131,13 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && export USE_PGXS=1 && make && make install; \ fi \ # pg_cron extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron \ + && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ + elif [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \ + && cd pg_cron \ + && make && make install; \ + fi \ # postgresql_anonymizer extension && pgxn install ddlx && pgxn install postgresql_anonymizer \ # pg_stat_kcache extension From fd62a29e1e434c3c7037ce5fe50ebd2c692fb0b4 Mon Sep 17 00:00:00 2001 From: Artyom Kartasov Date: Tue, 11 Jul 2023 07:55:58 +0000 Subject: [PATCH 11/22] feat: run Postgres instance with custom port and socket dir --- extended-postgres/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index e378cc7..e31f0a4 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -41,6 +41,12 @@ COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g ARG PG_SERVER_VERSION ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-15} +ARG PG_UNIX_SOCKET_DIR +ENV PG_UNIX_SOCKET_DIR=${PG_UNIX_SOCKET_DIR:-"/var/run/postgresql"} + +ARG PG_SERVER_PORT +ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432} + ARG PG_TIMETABLE_VERSION ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.3.0} ARG SET_USER_VERSION @@ -184,15 +190,15 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get clean -y autoclean \ && rm -rf /var/lib/apt/lists/* \ # remove standard pgdata - && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/ + && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/ -EXPOSE 5432 +EXPOSE ${PG_SERVER_PORT} # Prepare Postgres start script RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \ - && echo "chown -R postgres:postgres \${PGDATA} /var/run/postgresql" \ + && echo "chown -R postgres:postgres \${PGDATA} \${PG_UNIX_SOCKET_DIR}" \ >> /pg_start.sh \ - && printf "sudo -Eu postgres /usr/lib/postgresql/$(echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//')/bin/postgres -D \${PGDATA} >& /proc/1/fd/1 \n" \ + && printf "sudo -Eu postgres /usr/lib/postgresql/$(echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//')/bin/postgres -D \${PGDATA} -k \${PG_UNIX_SOCKET_DIR} -p \${PG_SERVER_PORT} >& /proc/1/fd/1 \n" \ >> /pg_start.sh \ # Infinite sleep to allow restarting Postgres && echo "/bin/bash -c \"trap : TERM INT; sleep infinity & wait\"" \ From 5d592506957b3cb855c6a0e4906eb44ccb2237fa Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 5 Sep 2023 15:16:19 +0000 Subject: [PATCH 12/22] Update Extended Docker Images and add PostgreSQL 16rc1 image --- README.md | 97 +++------------------------ extended-postgres/Dockerfile | 55 ++++++++------- extended-postgres/build-images-ci.yml | 16 +++++ 3 files changed, 59 insertions(+), 109 deletions(-) diff --git a/README.md b/README.md index 5a3719e..524336c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Storage-optimized: the size of each image is ~300-500 MiB. Use these images with Database Lab, when you need HypoPG or anything else. ### What's inside -Available PostgreSQL versions: 9.6 (EOL), 10, 11, 12, 13, 14, 15. Extensions: +Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Extensions: - all official ["core" contrib modules](https://www.postgresql.org/docs/current/contrib.html) - [bg_mon](https://github.com/CyberDem0n/bg_mon) - [Citus](https://github.com/citusdata/citus) @@ -23,6 +23,7 @@ Available PostgreSQL versions: 9.6 (EOL), 10, 11, 12, 13, 14, 15. Extensions: - [pg_repack](https://github.com/reorg/pg_repack) - [pg_show_plans](https://github.com/cybertec-postgresql/pg_show_plans) - [pg_stat_kcache](https://github.com/powa-team/pg_stat_kcache) +- [pg_wait_sampling](https://github.com/postgrespro/pg_wait_sampling) - [pg_timetable](https://github.com/cybertec-postgresql/pg_timetable) - [pgaudit](https://github.com/pgaudit/pgaudit) - [pgextwlist](https://github.com/dimitri/pgextwlist) @@ -31,100 +32,24 @@ Available PostgreSQL versions: 9.6 (EOL), 10, 11, 12, 13, 14, 15. Extensions: - [postgresql_anonymizer](https://github.com/webysther/postgresql_anonymizer) - [PoWA](https://github.com/powa-team/powa) - [set_user](https://github.com/pgaudit/set_user) -- [Timescale](https://github.com/timescale/timescaledb) +- [timescaledb](https://github.com/timescale/timescaledb) +- [pgvector](https://github.com/pgvector/pgvector) -#### Not included in the PostgreSQL 15 image (yet) -The PostgreSQL 15 image is now missing the following extensions (they will be added in the future): -- pg_repack +#### Not included in the PostgreSQL 16 image (yet) +The PostgreSQL 16 image is now missing the following extensions (they will be added in the future): +- pg_show_plans - pg_auth_mon - pg_hint_plan - timescaledb -- pg_cron -- pg_show_plans - -#### Not included in the PostgreSQL 14 image (yet) -The PostgreSQL 14 image is now missing the following extensions (they will be added in the future): -- pg_auth_mon +- citus +- powa +- pg_wait_sampling +- set_user ### How to extend - You can fork this repository and extend `Dockerfile`, then build your own images - Proposals to add more extensions to this repository are welcome https://gitlab.com/postgres-ai/custom-images/-/issues -### The complete list of available extensions -| name | version
(9.6) | version
(10) | version
(11) | version
(12) | version
(13) | version
(14) | comment | -| --- | --- | --- | --- | --- | --- | --- | --- | -| adminpack | 1.1 | 1.1 | 2.0 | 2.0 | 2.1 | 2.1 | administrative functions for PostgreSQL | -| amcheck | 2 | 1.0 | 1.1 | 1.2 | 1.2 | 1.3 | functions for verifying relation integrity. ("amcheck_next" for Postgres 9.6) | -| anon | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | Data anonymization tools | -| autoinc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for autoincrementing fields | -| bloom | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | bloom access method - signature file based index | -| btree_gin | 1.0 | 1.2 | 1.3 | 1.3 | 1.3 | 1.3 | support for indexing common datatypes in GIN | -| btree_gist | 1.2 | 1.5 | 1.5 | 1.5 | 1.5 | 1.6 | support for indexing common datatypes in GiST | -| citext | 1.3 | 1.4 | 1.5 | 1.6 | 1.6 | 1.6 | data type for case-insensitive character strings | -| citus | | | 10.0 | 10.2 | 11.1 | 11.1 | Citus distributed database | -| cube | 1.2 | 1.2 | 1.4 | 1.4 | 1.4 | 1.5 | data type for multidimensional cubes | -| dblink | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | connect to other PostgreSQL databases from within a database | -| ddlx | 0.22 | 0.22 | 0.22 | 0.22 | 0.22 | 0.22 | DDL eXtractor functions | -| dict_int | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | text search dictionary template for integers | -| dict_xsyn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | text search dictionary template for extended synonym processing | -| earthdistance | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | calculate great-circle distances on the surface of the Earth | -| file_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | foreign-data wrapper for flat file access | -| fuzzystrmatch | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | determine similarities and distance between strings | -| hll | 2.16 | 2.17 | 2.17 | 2.17 | 2.17 | 2.17 | type for storing hyperloglog data | -| hstore | 1.4 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | data type for storing sets of (key, value) pairs | -| hstore_plpython3u | 1.0 | 1.0 | 1.0 | 1 .0 | 1.0 | 1.0 | transform between hstore and plpython3u | -| hypopg | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | Hypothetical indexes for PostgreSQL | -| insert_username | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for tracking who changed a table | -| intagg | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | integer aggregator and enumerator (obsolete) | -| intarray | 1.2 | 1.2 | 1.2 | 1.2 | 1.3 | 1.5 | functions, operators, and index support for 1-D arrays of integers | -| isn | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | data types for international product numbering standards | -| jsonb_plpython3u | | | 1.0 | 1.0 | 1.0 | 1.0 | transform between jsonb and plpython3u | -| lo | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | Large Object maintenance | -| logerrors | | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | Function for collecting statistics about messages in logfile -| ltree | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 | 1.2 | data type for hierarchical tree-like structures | -| ltree_plpython3u | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | transform between ltree and plpython3u | -| moddatetime | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for tracking last modification time | -| moddatetime | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for tracking last modification time | -| old_snapshot | | | | | | 1.0 | iutilities in support of old_snapshot_threshold | -| pg_auth_mon | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | | monitor connection attempts per user | -| pg_buffercache | 1.2 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | examine the shared buffer cache | -| pg_cron | 1.4 | 1.4 | 1.4 | 1.4 | 1.4 | 1.4 | Job scheduler for PostgreSQL | -| pg_freespacemap | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | examine the free space map (FSM) | -| pg_hint_plan | 1.2.7 | 1.3.6 | 1.3.7 | 1.3.7 | 1.3.7 | 1.4 | makes it possible to tweak PostgreSQL execution plans using so-called "hints" in SQL comments | -| pg_prewarm | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | prewarm relation data | -| pg_qualstats | 2.0.3 | 2.0.4 | 2.0.4 | 2.0.4 | 2.0.4 | 2.0.4 | An extension collecting statistics about quals | -| pg_repack | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 | Reorganize tables in PostgreSQL databases with minimal locks | -| pg_show_plans | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | show query plans of all currently running SQL statements | -| pg_stat_kcache | 2.2.0 | 2.2.1 | 2.2.1 | 2.2.1 | 2.2.1 | 2.2.1 | Kernel statistics gathering | -| pg_wait_sampling | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | sampling based statistics of wait events | -| pg_stat_statements | 1.4 | 1.6 | 1.6 | 1.7 | 1.8 | 1.9 | track execution statistics of all SQL statements executed | -| pg_surgery | | | | | | 1.0 | extension to perform surgery on a damaged relation | -| pg_trgm | 1.3 | 1.3 | 1.4 | 1.4 | 1.5 | 1.6 | text similarity measurement and index searching based on trigrams | -| pg_visibility | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | examine the visibility map (VM) and page-level visibility info | -| pgaudit | 1.1.4 | 1.2.4 | 1.3.4 | 1.4.3 | 1.5.2 | 1.6.2 | provides auditing functionality | -| pgcrypto | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | cryptographic functions | -| pgrowlocks | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | show row-level locking information | -| pgstattuple | 1.4 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | show tuple-level statistics | -| plpgsql | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | PL/pgSQL procedural language | -| plpython3u | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | PL/Python3U untrusted procedural language | -| postgres_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.1 | foreign-data wrapper for remote PostgreSQL servers | -| powa | 4.1.2 | 4.1.4 | 4.1.4 | 4.1.4 | 4.1.4 | 4.1.4 | PostgreSQL Workload Analyser-core | -| refint | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for implementing referential integrity (obsolete) | -| seg | 1.1 | 1.1 | 1.3 | 1.3 | 1.3 | 1.4 | data type for representing line segments or floating-point intervals | -| set_user | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | similar to SET ROLE but with added logging | -| sslinfo | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | information about SSL certificates | -| tablefunc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions that manipulate whole tables, including crosstab | -| tcn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | Triggered change notifications | -| timescaledb | | | | 2.8.1 | 2.8.1 | 2.8.1 | Enables scalable inserts and complex queries for time-series data | -| timetravel | 1.0 | 1.0 | 1.0 | | | | functions for implementing time travel | -| topn | | 2.5.0 | 2.5.0 | 2.5.0 | 2.5.0 | 2.5.0 | type for top-n JSONB | -| tsm_system_rows | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | TABLESAMPLE method which accepts number of rows as a limit | -| tsm_system_time | 1.0 | 1.0 | 1.0 | 1.0 | 11.0 | 1.0 | TABLESAMPLE method which accepts time in milliseconds as a limit | -| unaccent | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | text search dictionary that removes accents | -| uuid-ossp | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | generate universally unique identifiers (UUIDs) | -| xml2 | 1.1 |1.1 | 1.1 | 1.1 | 1.1 | 1.1 | XPath querying and XSLT | - ### PostgreSQL Tools: - [WAL-G](https://github.com/wal-g/wal-g) - [pgBackRest](https://github.com/pgbackrest/pgbackrest) - diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index e31f0a4..00fc663 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -48,13 +48,14 @@ ARG PG_SERVER_PORT ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432} ARG PG_TIMETABLE_VERSION -ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.3.0} +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.5.0} ARG SET_USER_VERSION ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1} ARG LOGERRORS_VERSION ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2} ARG PGVECTOR_VERSION -ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.4.1} +ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.5.0} +# https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56 ARG PG_CRON_VERSION ENV PG_CRON_VERSION=${PG_CRON_VERSION:-1.4.2} @@ -82,14 +83,18 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pgaudit extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \ # pg_hint_plan extension - && export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ - && wget --quiet -O /tmp/pg_hint_plan.zip \ - https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ - && unzip /tmp/pg_hint_plan.zip -d /tmp \ - && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \ - && make && make install \ + && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ + && wget --quiet -O /tmp/pg_hint_plan.zip \ + https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ + && unzip /tmp/pg_hint_plan.zip -d /tmp \ + && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \ + && make && make install; \ + fi \ # powa extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa \ + && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa; \ + fi \ # pg_auth_mon extension && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ @@ -101,7 +106,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ fi \ fi \ # timescaledb extension - && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ @@ -109,12 +114,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ fi \ # citus extension - && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ if [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ - elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.1"; \ - elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="11.1"; \ - elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="11.1"; \ + elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.3"; \ + elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="12.0"; \ + elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="12.0"; \ fi \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ @@ -137,19 +142,21 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && export USE_PGXS=1 && make && make install; \ fi \ # pg_cron extension - && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ - elif [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \ - && cd pg_cron \ - && make && make install; \ + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \ + && cd pg_cron \ + && make && make install; \ + elif [ "${PG_SERVER_VERSION}" = "9.6" ] || [ "$PG_SERVER_VERSION" = "16" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ fi \ # postgresql_anonymizer extension && pgxn install ddlx && pgxn install postgresql_anonymizer \ # pg_stat_kcache extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ + && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \ + fi \ # pg_qualstats extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \ # bg_mon extension @@ -159,8 +166,10 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pgextwlist extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \ # set_user extension - && cd /tmp && git clone https://github.com/pgaudit/set_user.git \ - && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install \ + && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone https://github.com/pgaudit/set_user.git \ + && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install; \ + fi \ # logerrors extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ cd /tmp && wget -O logerrors.tar.gz https://github.com/munakoiso/logerrors/archive/v${LOGERRORS_VERSION}.tar.gz \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index fa2573e..99a98cf 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -102,6 +102,14 @@ build-extended-postgres-15-image-latest: PG_SERVER_VERSION: "15" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" +build-extended-postgres-16-image-latest: + <<: *build_image_definition_dh + <<: *only_tag_release + variables: + <<: *extended_image_vars_dh + PG_SERVER_VERSION: "16rc1" + TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" + build-extended-postgres-9-6-image-feature: <<: *build_image_definition_gl <<: *only_feature @@ -157,3 +165,11 @@ build-extended-postgres-15-image-feature: <<: *extended_image_vars_gl PG_SERVER_VERSION: "15" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" + +build-extended-postgres-16-image-feature: + <<: *build_image_definition_gl + <<: *only_feature + variables: + <<: *extended_image_vars_gl + PG_SERVER_VERSION: "16rc1" + TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From 1f8d5cbd8fd88d0d1a05291d39a7938d4830c2dd Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 18 Sep 2023 19:18:26 +0000 Subject: [PATCH 13/22] Add PostgresSQL 16 (release) --- README.md | 1 - extended-postgres/Dockerfile | 2 +- extended-postgres/build-images-ci.yml | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 524336c..516cd91 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Exte The PostgreSQL 16 image is now missing the following extensions (they will be added in the future): - pg_show_plans - pg_auth_mon -- pg_hint_plan - timescaledb - citus - powa diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 00fc663..f277530 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -83,7 +83,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pgaudit extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \ # pg_hint_plan extension - && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ && wget --quiet -O /tmp/pg_hint_plan.zip \ https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index 99a98cf..5e499ba 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -107,7 +107,7 @@ build-extended-postgres-16-image-latest: <<: *only_tag_release variables: <<: *extended_image_vars_dh - PG_SERVER_VERSION: "16rc1" + PG_SERVER_VERSION: "16" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" build-extended-postgres-9-6-image-feature: @@ -171,5 +171,5 @@ build-extended-postgres-16-image-feature: <<: *only_feature variables: <<: *extended_image_vars_gl - PG_SERVER_VERSION: "16rc1" + PG_SERVER_VERSION: "16" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From 4fb13f4cb5d133dac78aaef74707dcd46387021c Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Wed, 18 Oct 2023 20:04:03 +0000 Subject: [PATCH 14/22] Update Postgres 16 image (add previously missing extensions) --- README.md | 4 ---- extended-postgres/Dockerfile | 11 ++++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 516cd91..ec58ea9 100644 --- a/README.md +++ b/README.md @@ -37,12 +37,8 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Exte #### Not included in the PostgreSQL 16 image (yet) The PostgreSQL 16 image is now missing the following extensions (they will be added in the future): -- pg_show_plans - pg_auth_mon - timescaledb -- citus -- powa -- pg_wait_sampling - set_user ### How to extend diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index f277530..4c1ef1c 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -92,7 +92,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && make && make install; \ fi \ # powa extension - && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa; \ fi \ # pg_auth_mon extension @@ -114,12 +114,13 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ fi \ # citus extension - && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ if [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.3"; \ - elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="12.0"; \ - elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="12.0"; \ + elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="12.1"; \ + elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="12.1"; \ + elif [ "${PG_SERVER_VERSION}" = "16" ]; then CITUS_VERSION="12.1"; \ fi \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ @@ -154,7 +155,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pg_stat_kcache extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension - && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \ fi \ # pg_qualstats extension From 8a07d202249db3e621cca72356f2ecfb34ca5a37 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 4 Dec 2023 23:59:08 +0000 Subject: [PATCH 15/22] Update Postgres minor versions and extensions --- README.md | 1 - extended-postgres/Dockerfile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ec58ea9..618eb6f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Exte #### Not included in the PostgreSQL 16 image (yet) The PostgreSQL 16 image is now missing the following extensions (they will be added in the future): - pg_auth_mon -- timescaledb - set_user ### How to extend diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 4c1ef1c..0833cdd 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -106,7 +106,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ fi \ fi \ # timescaledb extension - && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ From 2312513e9dce4bf10cadaf7f7abe9166ad4c6627 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 26 Feb 2024 19:35:03 +0000 Subject: [PATCH 16/22] Update Postgres Docker images to latest minors (16.2, 15.6, 14.11, 13.14, 12.18) --- extended-postgres/Dockerfile | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 0833cdd..7e30de6 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -10,7 +10,7 @@ FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env ARG TARGETPLATFORM ARG GO_VERSION -ENV GO_VERSION=${GO_VERSION:-1.20.3} +ENV GO_VERSION=${GO_VERSION:-1.21.7} ARG WALG_VERSION ENV WALG_VERSION=${WALG_VERSION:-2.0.1} @@ -48,13 +48,13 @@ ARG PG_SERVER_PORT ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432} ARG PG_TIMETABLE_VERSION -ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.5.0} +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.8.0} ARG SET_USER_VERSION ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1} ARG LOGERRORS_VERSION ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2} ARG PGVECTOR_VERSION -ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.5.0} +ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.6.0} # https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56 ARG PG_CRON_VERSION ENV PG_CRON_VERSION=${PG_CRON_VERSION:-1.4.2} @@ -133,9 +133,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-topn; \ fi \ # pg_timetable extension - && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v${PG_TIMETABLE_VERSION}/pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ - && dpkg -i pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ - && rm -rf pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ + && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v"${PG_TIMETABLE_VERSION}"/pg_timetable_Linux_x86_64.deb \ + && dpkg -i pg_timetable_Linux_x86_64.deb \ + && rm -rf pg_timetable_Linux_x86_64.deb \ # pg_show_plans extension && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ cd /tmp && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ @@ -178,14 +178,19 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && USE_PGXS=1 make && USE_PGXS=1 make install; \ fi \ # pgvector extension - && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \ - && cd pgvector && make OPTFLAGS="" install \ - && mkdir /usr/share/doc/pgvector \ - && cp LICENSE README.md /usr/share/doc/pgvector \ - # it seems, v0.4.1 has incomplete setup process – we need to copy .sql manually - && cp sql/vector.sql /usr/share/postgresql/${PG_SERVER_VERSION}/extension/vector--${PGVECTOR_VERSION}.sql; \ - fi \ + && if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \ + && cd pgvector && make OPTFLAGS="" install \ + && mkdir /usr/share/doc/pgvector \ + && cp LICENSE README.md /usr/share/doc/pgvector \ + && cp sql/vector.sql /usr/share/postgresql/${PG_SERVER_VERSION}/extension/vector--${PGVECTOR_VERSION}.sql; \ + elif [ $(echo "$PG_SERVER_VERSION == 11" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git \ + && cd pgvector && make OPTFLAGS="" install \ + && mkdir /usr/share/doc/pgvector \ + && cp LICENSE README.md /usr/share/doc/pgvector \ + && cp sql/vector.sql /usr/share/postgresql/11/extension/vector--0.5.1.sql; \ + fi \ # pgBackRest && apt-get install --no-install-recommends -y \ pgbackrest zstd openssh-client \ From 944d064766fa9658d57924cb7f5af6bcc55fdf09 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Fri, 12 Jul 2024 21:14:34 +0000 Subject: [PATCH 17/22] Update Postgres Docker images to latest minors (16.3, 15.7, 14.12, 13.15, 12.19) --- extended-postgres/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 7e30de6..962a659 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -10,10 +10,10 @@ FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env ARG TARGETPLATFORM ARG GO_VERSION -ENV GO_VERSION=${GO_VERSION:-1.21.7} +ENV GO_VERSION=${GO_VERSION:-1.22.5} ARG WALG_VERSION -ENV WALG_VERSION=${WALG_VERSION:-2.0.1} +ENV WALG_VERSION=${WALG_VERSION:-3.0.2} RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # install dependencies @@ -29,6 +29,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # build WAL-G && cd /tmp && git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git \ && cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1 \ + && go mod tidy \ && make deps && GOBIN=/usr/local/bin make pg_install @@ -48,13 +49,13 @@ ARG PG_SERVER_PORT ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432} ARG PG_TIMETABLE_VERSION -ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.8.0} +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0} ARG SET_USER_VERSION ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1} ARG LOGERRORS_VERSION ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2} ARG PGVECTOR_VERSION -ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.6.0} +ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.7.2} # https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56 ARG PG_CRON_VERSION ENV PG_CRON_VERSION=${PG_CRON_VERSION:-1.4.2} @@ -151,7 +152,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ fi \ # postgresql_anonymizer extension - && pgxn install ddlx && pgxn install postgresql_anonymizer \ + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ + pgxn install ddlx && pgxn install postgresql_anonymizer; \ + fi \ # pg_stat_kcache extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension From a046b1670e4d635690c3d20f89ed38daaeccaddf Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Tue, 10 Sep 2024 15:53:27 +0000 Subject: [PATCH 18/22] Update Postgres to latest minors (16.4, 15.8, 14.13, 13.16, 12.20); install WAL-G from the binary file; PG16 is default --- extended-postgres/Dockerfile | 58 +++++++++++++----------------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 962a659..bbbcc67 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -2,45 +2,14 @@ # If you are using "physical" mode, please check the glibc version in your production database system to avoid potential index corruption. # You should have the same version of glibc as in your Docker image. -ARG PG_SERVER_VERSION=15 - -# build-env -FROM postgres:${PG_SERVER_VERSION}-bullseye as build-env - -ARG TARGETPLATFORM - -ARG GO_VERSION -ENV GO_VERSION=${GO_VERSION:-1.22.5} - -ARG WALG_VERSION -ENV WALG_VERSION=${WALG_VERSION:-3.0.2} - -RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ - # install dependencies - && apt-get update -o Acquire::CompressionTypes::Order::=gz \ - && apt-get install --no-install-recommends -y apt-transport-https ca-certificates \ - wget curl sudo git make cmake gcc build-essential \ - libbrotli-dev liblzo2-dev libsodium-dev \ - # install Go - && cd /tmp && GO_ARCH=$(if [ -z "${TARGETPLATFORM}" ]; then echo "amd64"; else echo ${TARGETPLATFORM} | cut -d '/' -f2; fi) \ - && export PATH=$PATH:/usr/local/go/bin && wget https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \ - && rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \ - && export PATH=$PATH:/usr/local/go/bin \ - # build WAL-G - && cd /tmp && git clone --branch v${WALG_VERSION} --single-branch https://github.com/wal-g/wal-g.git \ - && cd wal-g && export USE_LIBSODIUM=1 && export USE_LZO=1 \ - && go mod tidy \ - && make deps && GOBIN=/usr/local/bin make pg_install - +ARG PG_SERVER_VERSION=16 # Build the extended image FROM postgres:${PG_SERVER_VERSION}-bullseye LABEL maintainer="postgres.ai" -COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g - ARG PG_SERVER_VERSION -ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-15} +ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-16} ARG PG_UNIX_SOCKET_DIR ENV PG_UNIX_SOCKET_DIR=${PG_UNIX_SOCKET_DIR:-"/var/run/postgresql"} @@ -48,14 +17,21 @@ ENV PG_UNIX_SOCKET_DIR=${PG_UNIX_SOCKET_DIR:-"/var/run/postgresql"} ARG PG_SERVER_PORT ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432} +ARG WALG_VERSION +ENV WALG_VERSION=${WALG_VERSION:-3.0.3} + ARG PG_TIMETABLE_VERSION ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0} + ARG SET_USER_VERSION -ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_0_1} +ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_1_0} + ARG LOGERRORS_VERSION -ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.2} +ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.3} + ARG PGVECTOR_VERSION -ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.7.2} +ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.7.4} + # https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56 ARG PG_CRON_VERSION ENV PG_CRON_VERSION=${PG_CRON_VERSION:-1.4.2} @@ -170,9 +146,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pgextwlist extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \ # set_user extension - && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \ cd /tmp && git clone https://github.com/pgaudit/set_user.git \ && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install; \ + elif [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone https://github.com/pgaudit/set_user.git \ + && cd set_user && git checkout REL4_0_1 && make USE_PGXS=1 && make USE_PGXS=1 install; \ fi \ # logerrors extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ @@ -199,6 +178,11 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ pgbackrest zstd openssh-client \ && mkdir -p -m 700 /var/lib/postgresql/.ssh \ && chown postgres:postgres /var/lib/postgresql/.ssh \ + # WAL-G + && wget https://github.com/wal-g/wal-g/releases/download/v"${WALG_VERSION}"/wal-g-pg-ubuntu-20.04-amd64.tar.gz \ + && tar -zxvf wal-g-pg-ubuntu-20.04-amd64.tar.gz \ + && mv wal-g-pg-ubuntu-20.04-amd64 /usr/local/bin/wal-g \ + && wal-g --version \ # remove all auxilary packages to reduce final image size && cd / && rm -rf /tmp/* && apt-get purge -y --auto-remove \ gcc make wget unzip curl libc6-dev apt-transport-https git \ From ce949548fffba99a7d807339598437a32302d3bd Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Wed, 18 Sep 2024 18:25:46 +0000 Subject: [PATCH 19/22] Add PostgreSQL 17rc1 image --- README.md | 14 ++++-- extended-postgres/Dockerfile | 69 ++++++++++++++------------- extended-postgres/build-images-ci.yml | 16 +++++++ 3 files changed, 61 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 618eb6f..1462cb3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Storage-optimized: the size of each image is ~300-500 MiB. Use these images with Database Lab, when you need HypoPG or anything else. ### What's inside -Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Extensions: +Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11 (EOL), 12, 13, 14, 15, 16, 17. Extensions: - all official ["core" contrib modules](https://www.postgresql.org/docs/current/contrib.html) - [bg_mon](https://github.com/CyberDem0n/bg_mon) - [Citus](https://github.com/citusdata/citus) @@ -35,10 +35,14 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11, 12, 13, 14, 15, 16. Exte - [timescaledb](https://github.com/timescale/timescaledb) - [pgvector](https://github.com/pgvector/pgvector) -#### Not included in the PostgreSQL 16 image (yet) -The PostgreSQL 16 image is now missing the following extensions (they will be added in the future): -- pg_auth_mon -- set_user +#### Not included in the PostgreSQL 17 image (yet) +The PostgreSQL 17 image is now missing the following extensions (they will be added in the future): +- pg_repack +- powa +- timescaledb +- citus +- topn +- pg_qualstats ### How to extend - You can fork this repository and extend `Dockerfile`, then build your own images diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index bbbcc67..6d32137 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -23,9 +23,6 @@ ENV WALG_VERSION=${WALG_VERSION:-3.0.3} ARG PG_TIMETABLE_VERSION ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0} -ARG SET_USER_VERSION -ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_1_0} - ARG LOGERRORS_VERSION ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.3} @@ -43,7 +40,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && apt-get update -o Acquire::CompressionTypes::Order::=gz \ && apt-get install --no-install-recommends -y wget make gcc unzip sudo git \ curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \ - build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \ + build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils flex \ && apt-get install --no-install-recommends -y postgresql-server-dev-${PG_SERVER_VERSION} \ # plpython3 (procedural language implementation for Python 3.x) && apt-get install --no-install-recommends -y postgresql-plpython3-${PG_SERVER_VERSION} \ @@ -52,7 +49,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ apt-get install --no-install-recommends -y postgresql-9.6-amcheck; \ fi \ # pg_repack extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \ + && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack; \ + fi \ # hypopg extension && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-hypopg \ @@ -60,28 +59,27 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pgaudit extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \ # pg_hint_plan extension - && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-hint-plan; \ + else \ export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ - && wget --quiet -O /tmp/pg_hint_plan.zip \ - https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ + && wget --quiet -O /tmp/pg_hint_plan.zip https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ && unzip /tmp/pg_hint_plan.zip -d /tmp \ && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \ && make && make install; \ - fi \ + fi \ # powa extension && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa; \ fi \ # pg_auth_mon extension - && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ - if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ - cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ - && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ - elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch v2.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ - && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ - fi \ - fi \ + && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ + cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ + && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ + elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v3.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ + && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ + fi \ # timescaledb extension && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ @@ -105,7 +103,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # hll extension && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-hll \ # topn extension - && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-topn; \ fi \ @@ -115,16 +113,14 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && rm -rf pg_timetable_Linux_x86_64.deb \ # pg_show_plans extension && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ - && cd pg_show_plans \ - && export USE_PGXS=1 && make && make install; \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-show-plans; \ fi \ # pg_cron extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \ && cd pg_cron \ && make && make install; \ - elif [ "${PG_SERVER_VERSION}" = "9.6" ] || [ "$PG_SERVER_VERSION" = "16" ]; then \ + else \ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ fi \ # postgresql_anonymizer extension @@ -132,13 +128,18 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ pgxn install ddlx && pgxn install postgresql_anonymizer; \ fi \ # pg_stat_kcache extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ - # pg_wait_sampling extension && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache; \ + elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch REL2_3_0 https://github.com/powa-team/pg_stat_kcache.git \ + && cd pg_stat_kcache && make && make install; \ fi \ + # pg_wait_sampling extension + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ # pg_qualstats extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \ + && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats; \ + fi \ # bg_mon extension && apt-get install -y libevent-dev libbrotli-dev \ && cd /tmp && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ @@ -146,12 +147,14 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pgextwlist extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \ # set_user extension - && if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone https://github.com/pgaudit/set_user.git \ - && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install; \ - elif [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone https://github.com/pgaudit/set_user.git \ - && cd set_user && git checkout REL4_0_1 && make USE_PGXS=1 && make USE_PGXS=1 install; \ + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-set-user; \ + elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch REL4_1_0 https://github.com/pgaudit/set_user.git \ + && cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install; \ + elif [ $(echo "$PG_SERVER_VERSION == 9.6" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch REL4_0_1 https://github.com/pgaudit/set_user.git \ + && cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install; \ fi \ # logerrors extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index 5e499ba..82cdef1 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -110,6 +110,14 @@ build-extended-postgres-16-image-latest: PG_SERVER_VERSION: "16" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" +build-extended-postgres-17-image-latest: + <<: *build_image_definition_dh + <<: *only_tag_release + variables: + <<: *extended_image_vars_dh + PG_SERVER_VERSION: "17rc1" + TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" + build-extended-postgres-9-6-image-feature: <<: *build_image_definition_gl <<: *only_feature @@ -173,3 +181,11 @@ build-extended-postgres-16-image-feature: <<: *extended_image_vars_gl PG_SERVER_VERSION: "16" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" + +build-extended-postgres-17-image-feature: + <<: *build_image_definition_gl + <<: *only_feature + variables: + <<: *extended_image_vars_gl + PG_SERVER_VERSION: "17rc1" + TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From 5d2c6f578854a47cd6977754e2ff7639724e9ac7 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Wed, 9 Oct 2024 19:06:45 +0000 Subject: [PATCH 20/22] Add PostgreSQL 17 (release) --- README.md | 3 --- extended-postgres/Dockerfile | 10 +++------- extended-postgres/build-images-ci.yml | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1462cb3..8f158a1 100644 --- a/README.md +++ b/README.md @@ -37,12 +37,9 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11 (EOL), 12, 13, 14, 15, 16 #### Not included in the PostgreSQL 17 image (yet) The PostgreSQL 17 image is now missing the following extensions (they will be added in the future): -- pg_repack - powa -- timescaledb - citus - topn -- pg_qualstats ### How to extend - You can fork this repository and extend `Dockerfile`, then build your own images diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 6d32137..33bfaff 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -49,9 +49,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ apt-get install --no-install-recommends -y postgresql-9.6-amcheck; \ fi \ # pg_repack extension - && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack; \ - fi \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \ # hypopg extension && apt-get install --no-install-recommends -y \ postgresql-${PG_SERVER_VERSION}-hypopg \ @@ -81,7 +79,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ fi \ # timescaledb extension - && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ @@ -137,9 +135,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # pg_wait_sampling extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ # pg_qualstats extension - && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats; \ - fi \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \ # bg_mon extension && apt-get install -y libevent-dev libbrotli-dev \ && cd /tmp && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index 82cdef1..48e0870 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -115,7 +115,7 @@ build-extended-postgres-17-image-latest: <<: *only_tag_release variables: <<: *extended_image_vars_dh - PG_SERVER_VERSION: "17rc1" + PG_SERVER_VERSION: "17" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_TAG}" build-extended-postgres-9-6-image-feature: @@ -187,5 +187,5 @@ build-extended-postgres-17-image-feature: <<: *only_feature variables: <<: *extended_image_vars_gl - PG_SERVER_VERSION: "17rc1" + PG_SERVER_VERSION: "17" TAGS: "${DOCKER_NAME}:${PG_SERVER_VERSION},${DOCKER_NAME}:${PG_SERVER_VERSION}-${CI_COMMIT_REF_SLUG}" From 8357ae05422ad7e5de788e23b3b2de9216ad4941 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 14 Oct 2024 18:23:58 +0000 Subject: [PATCH 21/22] Fix bg_mon and add tests for extensions --- .gitlab-ci.yml | 2 + extended-postgres/Dockerfile | 19 ++- extended-postgres/test-images-ci.yml | 200 ++++++++++++++++++++++++++ extended-postgres/test/images_test.sh | 182 +++++++++++++++++++++++ 4 files changed, 396 insertions(+), 7 deletions(-) create mode 100644 extended-postgres/test-images-ci.yml create mode 100644 extended-postgres/test/images_test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d68714..8587b40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ stages: - build-image + - test-image include: - local: '/extended-postgres/build-images-ci.yml' + - local: '/extended-postgres/test-images-ci.yml' - local: '/migration-tools/build-images-migration-tools.yml' diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 33bfaff..bc78bbe 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -114,12 +114,17 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-show-plans; \ fi \ # pg_cron extension - && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \ - && cd pg_cron \ - && make && make install; \ - else \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ + # for PostgreSQL 10-15, install from source (https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56) + && if [ $(echo "$PG_SERVER_VERSION >= 10" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \ + && cd pg_cron \ + && make && make install; \ + elif [ $(echo "$PG_SERVER_VERSION == 9.6" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && git clone --branch v1.3.1 --single-branch https://github.com/citusdata/pg_cron.git \ + && cd pg_cron \ + && make && make install; \ + elif [ $(echo "$PG_SERVER_VERSION >= 16" | /usr/bin/bc) = "1" ]; then \ + apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \ fi \ # postgresql_anonymizer extension && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ @@ -187,7 +192,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ gcc make wget unzip curl libc6-dev apt-transport-https git \ postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \ libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \ - libgssrpc4 libevent-dev libbrotli-dev \ + libgssrpc4 \ && apt-get clean -y autoclean \ && rm -rf /var/lib/apt/lists/* \ # remove standard pgdata diff --git a/extended-postgres/test-images-ci.yml b/extended-postgres/test-images-ci.yml new file mode 100644 index 0000000..880b0c9 --- /dev/null +++ b/extended-postgres/test-images-ci.yml @@ -0,0 +1,200 @@ +stages: + - test-image + +.job_template: &test_image_definition + image: docker:19 + stage: test-image + services: + - alias: docker + name: docker:19.03.5-dind + script: + - apk add --no-cache bash + - chmod +x extended-postgres/test/images_test.sh + - TAG=${TAG} PG_IMAGE_NAME="${DOCKER_NAME}" PG_SERVER_VERSION=${PG_SERVER_VERSION} CREATE_EXTENSION_EXCLUDE=${CREATE_EXTENSION_EXCLUDE} bash extended-postgres/test/images_test.sh + +.only_tag_template: &only_release + rules: + - if: $CI_COMMIT_TAG =~ /^[0-9.]+$/ || $COMMIT_TAG =~ /^[0-9.]+$/ + when: always + +.release_vars: + variables: &release_vars + TAG: $CI_COMMIT_TAG + DOCKER_NAME: "postgresai/extended-postgres" + +.only_branch_template: &only_branch + rules: + - if: $CI_COMMIT_TAG =~ /^[0-9.]+$/ || $COMMIT_TAG =~ /^[0-9.]+$/ + when: never + - if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_SLUG != "master" + when: manual + +.branch_vars: + variables: &branch_vars + TAG: $CI_COMMIT_REF_SLUG + DOCKER_NAME: "${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/extended-postgres" + +test-extended-postgres-9-6-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-9-6-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "9.6" + CREATE_EXTENSION_EXCLUDE: "pg_cron" + +test-extended-postgres-10-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-10-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "10" + +test-extended-postgres-11-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-11-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "11" + +test-extended-postgres-12-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-12-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "12" + +test-extended-postgres-13-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-13-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "13" + +test-extended-postgres-14-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-14-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "14" + +test-extended-postgres-15-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-15-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "15" + +test-extended-postgres-16-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-16-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "16" + +test-extended-postgres-17-image-latest: + <<: *test_image_definition + <<: *only_release + dependencies: + - build-extended-postgres-17-image-latest + variables: + <<: *release_vars + PG_SERVER_VERSION: "17" + + +test-extended-postgres-9-6-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-9-6-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "9.6" + CREATE_EXTENSION_EXCLUDE: "pg_cron" + +test-extended-postgres-10-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-10-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "10" + +test-extended-postgres-11-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-11-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "11" + +test-extended-postgres-12-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-12-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "12" + +test-extended-postgres-13-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-13-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "13" + +test-extended-postgres-14-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-14-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "14" + +test-extended-postgres-15-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-15-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "15" + +test-extended-postgres-16-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-16-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "16" + +test-extended-postgres-17-image-feature: + <<: *test_image_definition + <<: *only_branch + dependencies: + - build-extended-postgres-17-image-feature + variables: + <<: *branch_vars + PG_SERVER_VERSION: "17" diff --git a/extended-postgres/test/images_test.sh b/extended-postgres/test/images_test.sh new file mode 100644 index 0000000..bf2e2af --- /dev/null +++ b/extended-postgres/test/images_test.sh @@ -0,0 +1,182 @@ +#!/bin/bash +set -euxo pipefail + +# 1. Initializes the database using the base Postgres image and also performs some additional actions, +# such as creating a test_contrib_extensions table and copying the list of available extensions into the Docker container. +# 2. Modifies the postgresql.conf configuration file to load certain preloaded libraries. +# 3. Starts PostgreSQL and creates a test_contrib_extensions table for testing. +# 4. Runs tests which create all available extensions not included in the test_contrib_extensions table. +# 5. At the end of the tests, it stops PostgreSQL and deletes the test data. +# +# USAGE (example): +# TAG="0.5.0" PG_SERVER_VERSION="16" ./se_images_test.sh +# +## (optional) With a list of extensions (separated by commas) to exclude from the create extension test: +# TAG="0.5.0" PG_SERVER_VERSION="10" CREATE_EXTENSION_EXCLUDE="pg_cron" ./se_images_test.sh + +# list of extensions (separated by commas) to exclude from the create extension test +CREATE_EXTENSION_EXCLUDE=${CREATE_EXTENSION_EXCLUDE:-} +if [[ -n "$CREATE_EXTENSION_EXCLUDE" ]]; then + IFS=',' read -ra NAMES <<< "$CREATE_EXTENSION_EXCLUDE" + formatted_exclusions=$(printf ", '%s'" "${NAMES[@]}") + formatted_exclusions=${formatted_exclusions:2} + exclude_condition="and name not in (${formatted_exclusions})" +else + exclude_condition="" +fi + +# list of extensions (separated by commas) to exclude from the compare extensions test +COMPARE_EXTENSION_EXCLUDE=${COMPARE_EXTENSION_EXCLUDE:-} +formatted_exclusions_compare="" + +if [[ -n "$COMPARE_EXTENSION_EXCLUDE" ]]; then + IFS=',' read -ra NAMES <<< "$COMPARE_EXTENSION_EXCLUDE" + formatted_exclusions_compare=$(printf ", '%s'" "${NAMES[@]}") + formatted_exclusions_compare=${formatted_exclusions_compare:2} +fi + +if [[ -n "$formatted_exclusions_compare" ]]; then + exclude_condition_compare="and name not in (${formatted_exclusions_compare})" +else + exclude_condition_compare="" +fi + +TAG=${TAG:-${CI_COMMIT_REF_SLUG:-"master"}} +PG_IMAGE_NAME="${PG_IMAGE_NAME:-'postgresai/extended-postgres'}" +PG_SERVER_VERSION=${PG_SERVER_VERSION//,/ } +PG_CONTAINER_NAME="postgres-${PG_SERVER_VERSION}" + +# initdb using the base image +TEST_DIR="/tmp/test_image/${PG_CONTAINER_NAME}" +TEST_PGDATA="${TEST_DIR}/data" + +rm -rf "${TEST_PGDATA}" && mkdir -p "${TEST_PGDATA}" + +docker stop "${PG_CONTAINER_NAME}" >/dev/null 2>&1 || true +docker run -d --rm --name "${PG_CONTAINER_NAME}" \ + -e PGDATA=/var/lib/postgresql/pgdata \ + -e POSTGRES_HOST_AUTH_METHOD=trust \ + -v "${TEST_PGDATA}":/var/lib/postgresql/pgdata \ +postgres:"${PG_SERVER_VERSION}"-bullseye >/dev/null 2>&1 + +postgres_readiness(){ + docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c 'select 1' > /dev/null 2>&1 + return $? +} + +check_postgres_readiness(){ + for i in {1..30}; do + postgres_readiness && break || echo "database is not ready yet" + sleep 4 + done +} + +check_postgres_readiness + +# Restart container explicitly after initdb +# to make sure that the server will not receive a shutdown request and queries will not be interrupted. +docker restart "${PG_CONTAINER_NAME}" + +check_postgres_readiness + +# export pg_available_extensions from base Postgres image +docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c \ + "copy (select * from pg_available_extensions) to stdout with csv header delimiter ',';" \ + > "${TEST_DIR}/available_extensions_${PG_SERVER_VERSION}.csv" + +# stop postgres after initdb +docker stop "${PG_CONTAINER_NAME}" >/dev/null 2>&1 + +# configure postgresql.conf +CLEANED_PG_SERVER_VERSION=$(echo "$PG_SERVER_VERSION" | sed 's/rc.*//') +BASE_LIBRARIES="pg_stat_statements,pg_stat_kcache,pg_cron,pgaudit,bg_mon" +if [ "$(echo "$CLEANED_PG_SERVER_VERSION == 17" | /usr/bin/bc)" = "1" ]; then + SHARED_PRELOAD_LIBRARIES="timescaledb,anon,${BASE_LIBRARIES}" +elif [ "$(echo "$CLEANED_PG_SERVER_VERSION >= 12" | /usr/bin/bc)" = "1" ]; then + SHARED_PRELOAD_LIBRARIES="citus,timescaledb,anon,${BASE_LIBRARIES}" +elif [ "$(echo "$CLEANED_PG_SERVER_VERSION == 11" | /usr/bin/bc)" = "1" ]; then + SHARED_PRELOAD_LIBRARIES="citus,anon,${BASE_LIBRARIES}" +elif [ "$(echo "$CLEANED_PG_SERVER_VERSION == 10" | /usr/bin/bc)" = "1" ]; then + SHARED_PRELOAD_LIBRARIES="anon,${BASE_LIBRARIES}" +else + SHARED_PRELOAD_LIBRARIES="${BASE_LIBRARIES}" +fi + +# pull docker image +docker pull "${PG_IMAGE_NAME}":"${PG_SERVER_VERSION}"-"${TAG}" + +# docker image size +docker images --filter=reference="${PG_IMAGE_NAME}:${PG_SERVER_VERSION}-${TAG}" + +# start postgres and create test_contrib_extensions table for test +docker run -d --rm --name "${PG_CONTAINER_NAME}" \ + -e PGDATA=/var/lib/postgresql/pgdata \ + -v "${TEST_PGDATA}":/var/lib/postgresql/pgdata \ + --shm-size=1gb \ + "${PG_IMAGE_NAME}":"${PG_SERVER_VERSION}"-"${TAG}" >/dev/null 2>&1 + +docker cp "${TEST_DIR}/available_extensions_${PG_SERVER_VERSION}.csv" "${PG_CONTAINER_NAME}":/tmp/ + +# shared_preload_libraries +docker exec "${PG_CONTAINER_NAME}" \ + bash -c "echo \"shared_preload_libraries = '${SHARED_PRELOAD_LIBRARIES}'\" >> /var/lib/postgresql/pgdata/postgresql.conf" + +# cron.database_name +docker exec "${PG_CONTAINER_NAME}" \ + bash -c "echo \"cron.database_name = 'postgres'\" >> /var/lib/postgresql/pgdata/postgresql.conf" + +docker restart "${PG_CONTAINER_NAME}" + +# debug +docker logs "${PG_CONTAINER_NAME}" + +check_postgres_readiness + +docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c "create table test_contrib_extensions (like pg_available_extensions)" + +docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c \ + "\copy test_contrib_extensions + from '/tmp/available_extensions_${PG_SERVER_VERSION}.csv' delimiter ',' csv header" + +# list of available (non-contrib) extensions +docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c " + select name, default_version, comment + from pg_available_extensions + where name not in (select name from test_contrib_extensions) + order by 1" + +# run test - create (non-contrib) extensions +set +x # disable loop command output +for extension in $( + docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -tAXc " + select name + from pg_available_extensions + where + name not in (select name from test_contrib_extensions) + ${exclude_condition} + order by 1" +); do + echo "create extension \"$extension\"" + docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS \"$extension\" CASCADE" +done + +set -x # enable command output again + +# list of installed extensions +docker exec "${PG_CONTAINER_NAME}" \ + psql -U postgres -c "\dx" + +# stop postgres after test +docker stop "${PG_CONTAINER_NAME}" +rm -rf "${TEST_PGDATA}" + +# remove docker image after test +docker rmi "${PG_IMAGE_NAME}":"${PG_SERVER_VERSION}"-"${TAG}" >/dev/null 2>&1 || true +docker rmi postgres:"${PG_SERVER_VERSION}"-bullseye >/dev/null 2>&1 || true From 639a82da18919693602270f3365a6ee003be2553 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Mon, 24 Feb 2025 15:15:38 +0000 Subject: [PATCH 22/22] Update Postgres Docker images to latest minors (17.4, 16.8, 15.12, 14.17, 13.20, 12.22) --- README.md | 8 +--- extended-postgres/Dockerfile | 42 ++++++++----------- extended-postgres/build-images-ci.yml | 8 ++-- extended-postgres/test-images-ci.yml | 4 +- extended-postgres/test/images_test.sh | 4 +- .../build-images-migration-tools.yml | 8 ++-- 6 files changed, 29 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 8f158a1..d850d54 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Storage-optimized: the size of each image is ~300-500 MiB. Use these images with Database Lab, when you need HypoPG or anything else. ### What's inside -Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11 (EOL), 12, 13, 14, 15, 16, 17. Extensions: +Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11 (EOL), 12(EOL), 13, 14, 15, 16, 17. Extensions: - all official ["core" contrib modules](https://www.postgresql.org/docs/current/contrib.html) - [bg_mon](https://github.com/CyberDem0n/bg_mon) - [Citus](https://github.com/citusdata/citus) @@ -35,12 +35,6 @@ Available PostgreSQL versions: 9.6 (EOL), 10 (EOL), 11 (EOL), 12, 13, 14, 15, 16 - [timescaledb](https://github.com/timescale/timescaledb) - [pgvector](https://github.com/pgvector/pgvector) -#### Not included in the PostgreSQL 17 image (yet) -The PostgreSQL 17 image is now missing the following extensions (they will be added in the future): -- powa -- citus -- topn - ### How to extend - You can fork this repository and extend `Dockerfile`, then build your own images - Proposals to add more extensions to this repository are welcome https://gitlab.com/postgres-ai/custom-images/-/issues diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index bc78bbe..e36ce8e 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -18,16 +18,16 @@ ARG PG_SERVER_PORT ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432} ARG WALG_VERSION -ENV WALG_VERSION=${WALG_VERSION:-3.0.3} +ENV WALG_VERSION=${WALG_VERSION:-3.0.5} ARG PG_TIMETABLE_VERSION -ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0} +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.11.0} ARG LOGERRORS_VERSION ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.3} ARG PGVECTOR_VERSION -ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.7.4} +ENV PGVECTOR_VERSION=${PGVECTOR_VERSION:-0.8.0} # https://gitlab.com/postgres-ai/custom-images/-/merge_requests/56 ARG PG_CRON_VERSION @@ -67,9 +67,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && make && make install; \ fi \ # powa extension - && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa; \ - fi \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa \ # pg_auth_mon extension && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \ @@ -87,13 +85,14 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ fi \ # citus extension - && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \ if [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ elif [ "${PG_SERVER_VERSION}" = "13" ]; then CITUS_VERSION="11.3"; \ elif [ "${PG_SERVER_VERSION}" = "14" ]; then CITUS_VERSION="12.1"; \ - elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="12.1"; \ - elif [ "${PG_SERVER_VERSION}" = "16" ]; then CITUS_VERSION="12.1"; \ + elif [ "${PG_SERVER_VERSION}" = "15" ]; then CITUS_VERSION="13.0"; \ + elif [ "${PG_SERVER_VERSION}" = "16" ]; then CITUS_VERSION="13.0"; \ + elif [ "${PG_SERVER_VERSION}" = "17" ]; then CITUS_VERSION="13.0"; \ fi \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}"; \ @@ -101,7 +100,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ # hll extension && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-hll \ # topn extension - && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}"-topn; \ fi \ @@ -131,12 +130,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ pgxn install ddlx && pgxn install postgresql_anonymizer; \ fi \ # pg_stat_kcache extension - && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \ - apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache; \ - elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch REL2_3_0 https://github.com/powa-team/pg_stat_kcache.git \ - && cd pg_stat_kcache && make && make install; \ - fi \ + && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ # pg_wait_sampling extension && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ # pg_qualstats extension @@ -164,19 +158,17 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ && USE_PGXS=1 make && USE_PGXS=1 make install; \ fi \ # pgvector extension - && if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \ + && if [ $(echo "$PG_SERVER_VERSION >= 11" | /usr/bin/bc) = "1" ]; then \ + if [ "${PG_SERVER_VERSION}" = "11" ]; then PGVECTOR_VERSION="0.5.1"; \ + elif [ "${PG_SERVER_VERSION}" = "12" ]; then PGVECTOR_VERSION="0.7.4"; \ + else PGVECTOR_VERSION="${PGVECTOR_VERSION}"; \ + fi \ + && cd /tmp && git clone --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \ && cd pgvector && make OPTFLAGS="" install \ && mkdir /usr/share/doc/pgvector \ && cp LICENSE README.md /usr/share/doc/pgvector \ && cp sql/vector.sql /usr/share/postgresql/${PG_SERVER_VERSION}/extension/vector--${PGVECTOR_VERSION}.sql; \ - elif [ $(echo "$PG_SERVER_VERSION == 11" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git \ - && cd pgvector && make OPTFLAGS="" install \ - && mkdir /usr/share/doc/pgvector \ - && cp LICENSE README.md /usr/share/doc/pgvector \ - && cp sql/vector.sql /usr/share/postgresql/11/extension/vector--0.5.1.sql; \ - fi \ + fi \ # pgBackRest && apt-get install --no-install-recommends -y \ pgbackrest zstd openssh-client \ diff --git a/extended-postgres/build-images-ci.yml b/extended-postgres/build-images-ci.yml index 48e0870..9807e04 100644 --- a/extended-postgres/build-images-ci.yml +++ b/extended-postgres/build-images-ci.yml @@ -2,11 +2,11 @@ stages: - build-image .job_template: &build_image_definition_dh - image: docker:19 + image: docker:24.0.6 stage: build-image services: - alias: docker - name: docker:19.03.5-dind + name: docker:24.0.6-dind script: - apk add --no-cache bash - bash ./ci_docker_build_push.sh @@ -18,11 +18,11 @@ stages: DOCKER_NAME: "postgresai/extended-postgres" .job_template: &build_image_definition_gl - image: docker:19 + image: docker:24.0.6 stage: build-image services: - alias: docker - name: docker:19.03.5-dind + name: docker:24.0.6-dind script: - apk add --no-cache bash - bash ./ci_docker_build_push.sh diff --git a/extended-postgres/test-images-ci.yml b/extended-postgres/test-images-ci.yml index 880b0c9..077a75a 100644 --- a/extended-postgres/test-images-ci.yml +++ b/extended-postgres/test-images-ci.yml @@ -2,11 +2,11 @@ stages: - test-image .job_template: &test_image_definition - image: docker:19 + image: docker:24.0.6 stage: test-image services: - alias: docker - name: docker:19.03.5-dind + name: docker:24.0.6-dind script: - apk add --no-cache bash - chmod +x extended-postgres/test/images_test.sh diff --git a/extended-postgres/test/images_test.sh b/extended-postgres/test/images_test.sh index bf2e2af..819ba27 100644 --- a/extended-postgres/test/images_test.sh +++ b/extended-postgres/test/images_test.sh @@ -92,9 +92,7 @@ docker stop "${PG_CONTAINER_NAME}" >/dev/null 2>&1 # configure postgresql.conf CLEANED_PG_SERVER_VERSION=$(echo "$PG_SERVER_VERSION" | sed 's/rc.*//') BASE_LIBRARIES="pg_stat_statements,pg_stat_kcache,pg_cron,pgaudit,bg_mon" -if [ "$(echo "$CLEANED_PG_SERVER_VERSION == 17" | /usr/bin/bc)" = "1" ]; then - SHARED_PRELOAD_LIBRARIES="timescaledb,anon,${BASE_LIBRARIES}" -elif [ "$(echo "$CLEANED_PG_SERVER_VERSION >= 12" | /usr/bin/bc)" = "1" ]; then +if [ "$(echo "$CLEANED_PG_SERVER_VERSION >= 12" | /usr/bin/bc)" = "1" ]; then SHARED_PRELOAD_LIBRARIES="citus,timescaledb,anon,${BASE_LIBRARIES}" elif [ "$(echo "$CLEANED_PG_SERVER_VERSION == 11" | /usr/bin/bc)" = "1" ]; then SHARED_PRELOAD_LIBRARIES="citus,anon,${BASE_LIBRARIES}" diff --git a/migration-tools/build-images-migration-tools.yml b/migration-tools/build-images-migration-tools.yml index ba832a8..616dedf 100644 --- a/migration-tools/build-images-migration-tools.yml +++ b/migration-tools/build-images-migration-tools.yml @@ -2,11 +2,11 @@ stages: - build-image .job_template: &build_image_definition_dh - image: docker:19 + image: docker:24.0.6 stage: build-image services: - alias: docker - name: docker:19.03.5-dind + name: docker:24.0.6-dind script: - apk add --no-cache bash - bash ./ci_docker_build_push.sh @@ -17,11 +17,11 @@ stages: DOCKER_NAME: "postgresai/migration-tools" .job_template: &build_image_definition_gl - image: docker:19 + image: docker:24.0.6 stage: build-image services: - alias: docker - name: docker:19.03.5-dind + name: docker:24.0.6-dind script: - apk add --no-cache bash - bash ./ci_docker_build_push.sh