diff --git a/Makefile b/Makefile index 5d5eff8..fc74f86 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ BASE_IMAGE ?= rockylinux/rockylinux:9 BASEOS ?= rocky9 CONTAINERIMAGE ?= rockylinux/rockylinux:9-ubi-micro -IMAGE_REPOSITORY ?= docker.io +IMAGE_REPOSITORY ?= containers.cybertec.at IMAGE_PATH ?= cybertec-pg-container PGVERSION ?= 18 PGVERSION_FULL ?= 18.1 @@ -14,10 +14,12 @@ POSTGIS_VERSION ?= 36 ETCD_VERSION ?= 3.6.6 PGBOUNCER_VERSION ?= 1.25 PACKAGER ?= dnf -BUILD ?= 1 +BUILD ?= 2 ARCH ?= amd64 IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD) POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD) +PGBOUNCER_IMAGE_TAG ?= $(BASEOS)-$(PGBOUNCER_VERSION)-$(BUILD) +REPOSITORY ?= containers.cybertec.at # Public-Beta PUBLICBETA ?= 3 @@ -44,7 +46,7 @@ publicbeta: publicbeta-pg publicbeta-pgbackrest base-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/base/Dockerfile \ - --tag cybertec-pg-container/base:$(BASEOS)-$(BUILD) \ + --tag $(IMAGE_PATH)/base:$(BASEOS)-$(BUILD) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ --build-arg BASEOS=$(BASEOS) \ @@ -56,7 +58,7 @@ base: base-build; pgbackrest-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/pgbackrest/Dockerfile \ - --tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG) \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/pgbackrest:$(IMAGE_TAG) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -74,7 +76,7 @@ pgbackrest: pgbackrest-build; postgres-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/postgres/Dockerfile \ - --tag cybertec-pg-container/postgres:$(IMAGE_TAG) \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/postgres:$(IMAGE_TAG) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -94,7 +96,7 @@ postgres: postgres-build postgres-gis-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/postgres-gis/Dockerfile \ - --tag cybertec-pg-container/postgres-gis:$(IMAGE_TAG) \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/postgres-gis:$(POSTGIS_IMAGE_TAG) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -115,7 +117,7 @@ postgres-gis: postgres-gis-build postgres-oracle-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/postgres-oracle/Dockerfile \ - --tag cybertec-pg-container/postgres-oracle:$(IMAGE_TAG) \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/postgres-oracle:$(IMAGE_TAG) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -135,7 +137,7 @@ postgres-oracle: postgres-oracle-build pgbouncer-build: docker build $(ROOTPATH) --no-cache \ --file $(ROOTPATH)/docker/pgbouncer/Dockerfile \ - --tag cybertec-pg-container/pgbouncer:$(IMAGE_TAG) \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/pgbouncer:$(PGBOUNCER_IMAGE_TAG) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -151,7 +153,7 @@ pgbouncer: pgbouncer-build exporter-build: docker build $(ROOTPATH) --no-cache \ --file $(ROOTPATH)/docker/exporter/Dockerfile \ - --tag cybertec-pg-container/exporter:$(IMAGE_TAG) \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/exporter:$(IMAGE_TAG) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -167,7 +169,7 @@ exporter: exporter-build publicbeta-pg-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/pg-public-beta/Dockerfile \ - --tag cybertec-pg-container/postgres:$(IMAGE_TAG)-beta${PUBLICBETA} \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/postgres:$(IMAGE_TAG)-beta${PUBLICBETA} \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ @@ -187,7 +189,7 @@ publicbeta-pg: publicbeta-pg-build publicbeta-pgbackrest-build: docker build $(ROOTPATH) \ --file $(ROOTPATH)/docker/pgbackrest-public-beta/Dockerfile \ - --tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG)-beta${PUBLICBETA} \ + --tag $(REPOSITORY)/$(IMAGE_PATH)/pgbackrest:$(IMAGE_TAG)-beta${PUBLICBETA} \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \ --build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \ diff --git a/docker/exporter/Dockerfile b/docker/exporter/Dockerfile index 8c754a3..9a63830 100644 --- a/docker/exporter/Dockerfile +++ b/docker/exporter/Dockerfile @@ -15,7 +15,7 @@ RUN ${PACKAGER} -y install --nodocs \ make \ && ${PACKAGER} -y clean all ; -RUN wget https://go.dev/dl/go1.24.4.linux-amd64.tar.gz && tar -xzf go1.24.4.linux-amd64.tar.gz && mv go /usr/local +RUN wget https://go.dev/dl/go1.25.5.linux-amd64.tar.gz && tar -xzf go1.25.5.linux-amd64.tar.gz && mv go /usr/local ENV PATH=$PATH:/usr/local/go/bin RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter && make build; diff --git a/docker/pgbackrest/Dockerfile b/docker/pgbackrest/Dockerfile index 03a2032..6217cdb 100644 --- a/docker/pgbackrest/Dockerfile +++ b/docker/pgbackrest/Dockerfile @@ -108,7 +108,7 @@ COPY --from=builder /usr/bin/trust /usr/bin/ # libraries COPY --from=builder /usr/bin/nss_wrapper.pl /usr/bin/nss_wrapper.pl -# COPY --from=builder /usr/lib64/libnss_wrapper.so /usr/lib64/libnss_wrapper.so +COPY --from=builder /usr/lib64/libnss_wrapper.so /usr/lib64/libnss_wrapper.so COPY --from=builder /usr/share/man/man1 /usr/share/man/man1 COPY --from=builder /usr/bin/envsubst /usr/bin/envsubst @@ -161,6 +161,10 @@ VOLUME ["sshd", "/home/postgres/pgdata", "/backrestrepo"] ENTRYPOINT ["/scripts/nss_wrapper/nss_wrapper.sh"] +ENV LD_PRELOAD=/usr/lib64/libnss_wrapper.so \ + NSS_WRAPPER_PASSWD=/tmp/nss_wrapper/passwd \ + NSS_WRAPPER_GROUP=/tmp/nss_wrapper/group + USER postgres CMD ["dumb-init", "/launch.sh", "init"] diff --git a/docker/postgres-gis/Dockerfile b/docker/postgres-gis/Dockerfile index 9b8e79f..e3146de 100644 --- a/docker/postgres-gis/Dockerfile +++ b/docker/postgres-gis/Dockerfile @@ -77,7 +77,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python && git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \ && git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \ && git clone https://github.com/dimitri/pgextwlist.git \ - && git clone https://github.com/crunchydata/pgnodemx \ + # && git clone https://github.com/crunchydata/pgnodemx \ \ && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 postgresql${PGVERSION} libevent-devel brotli-devel libbrotli \ && ${PACKAGER} -y clean all \ @@ -94,7 +94,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python # Install PostgreSQL binaries, contrib, plproxy and multiple pl's && ${PACKAGER} -y install -y postgresql${version}-contrib \ postgresql${version}-plpython3 postgresql${version}-devel \ - pg_cron_${version} pgvector_${version} set_user_${version} \ + pg_cron_${version} pgvector_${version} set_user_${version} pgnodemx_${version} \ # Modify for using origial-spilo scripts && ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \ && export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \ @@ -106,8 +106,8 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python && for n in pg_permissions $EXTRA_EXTENSIONS; do \ make -C $n USE_PGXS=1 clean install-strip; \ done \ - && cd /pgextwlist && make clean && make && make install \ - && cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \ + && cd /pgextwlist && make clean && make && make install; \ + # && cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \ done \ && ${PACKAGER} -y install pgbackrest-${PGBACKREST_VERSION} \ && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-static \ @@ -194,8 +194,7 @@ RUN rm -rf /etc/service && mkdir /home/postgres/pgdata && chown -R postgres:post && chgrp -R 0 $PGHOME $RW_DIR \ && chmod -R g=u $PGHOME $RW_DIR \ && usermod -a -G root postgres; \ - fi - + fi COPY scripts bootstrap major_upgrade /scripts/ COPY launcher/postgres/launch.sh / diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index ee9557f..cc9f2fe 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -76,7 +76,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python && git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \ && git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \ && git clone https://github.com/dimitri/pgextwlist.git \ - && git clone https://github.com/crunchydata/pgnodemx \ + # && git clone https://github.com/crunchydata/pgnodemx \ \ && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 postgresql${PGVERSION} libevent-devel brotli-devel libbrotli \ && ${PACKAGER} -y clean all \ @@ -93,7 +93,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python # Install PostgreSQL binaries, contrib, plproxy and multiple pl's && ${PACKAGER} -y install -y postgresql${version}-contrib \ postgresql${version}-plpython3 postgresql${version}-devel \ - pg_cron_${version} pgvector_${version} set_user_${version} \ + pg_cron_${version} pgvector_${version} set_user_${version} pgnodemx_${version} \ # Modify for using origial-spilo scripts && ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \ && export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \ @@ -103,8 +103,8 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python && for n in pg_permissions $EXTRA_EXTENSIONS; do \ make -C $n USE_PGXS=1 clean install-strip; \ done \ - && cd /pgextwlist && make clean && make && make install \ - && cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \ + && cd /pgextwlist && make clean && make && make install; \ + # && cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \ done \ && ${PACKAGER} -y install pgbackrest-${PGBACKREST_VERSION} \ && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-static \ @@ -191,8 +191,7 @@ RUN rm -rf /etc/service && mkdir /home/postgres/pgdata && chown -R postgres:post && chgrp -R 0 $PGHOME $RW_DIR \ && chmod -R g=u $PGHOME $RW_DIR \ && usermod -a -G root postgres; \ - fi - + fi COPY scripts bootstrap major_upgrade /scripts/ COPY launcher/postgres/launch.sh / diff --git a/scripts/postgres/promote.sh b/scripts/postgres/promote.sh index d279248..f3d8e16 100755 --- a/scripts/postgres/promote.sh +++ b/scripts/postgres/promote.sh @@ -10,5 +10,6 @@ done source "/scripts/postgres/shell_lib.sh" output_info "pgBackRest: Promote Database because of earlier pgBackRest-Restore." -pg_ctl promote -D ${PGDATA} +DETECTED_VERSION=$(cat "${PGDATA}/PG_VERSION") +/usr/pgsql-${DETECTED_VERSION}/bin/pg_ctl promote -D ${PGDATA} rm -f "${PGDATA}/promote_after_restore.signal" \ No newline at end of file