Skip to content

Commit 3360197

Browse files
authored
Merge pull request #82 from cybertec-postgresql/updateDockerfiles
Update dockerfiles
2 parents caa689a + e0cd925 commit 3360197

File tree

5 files changed

+29
-25
lines changed

5 files changed

+29
-25
lines changed

Makefile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
BASE_IMAGE ?= rockylinux/rockylinux:9
44
BASEOS ?= rocky9
55
CONTAINERIMAGE ?= rockylinux/rockylinux:9-ubi-micro
6-
IMAGE_REPOSITORY ?= docker.io
6+
IMAGE_REPOSITORY ?= containers.cybertec.at
77
IMAGE_PATH ?= cybertec-pg-container
88
PGVERSION ?= 18
99
PGVERSION_FULL ?= 18.1
@@ -14,10 +14,12 @@ POSTGIS_VERSION ?= 36
1414
ETCD_VERSION ?= 3.6.6
1515
PGBOUNCER_VERSION ?= 1.25
1616
PACKAGER ?= dnf
17-
BUILD ?= 1
17+
BUILD ?= 2
1818
ARCH ?= amd64
1919
IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD)
2020
POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD)
21+
PGBOUNCER_IMAGE_TAG ?= $(BASEOS)-$(PGBOUNCER_VERSION)-$(BUILD)
22+
REPOSITORY ?= containers.cybertec.at
2123

2224
# Public-Beta
2325
PUBLICBETA ?= 3
@@ -44,7 +46,7 @@ publicbeta: publicbeta-pg publicbeta-pgbackrest
4446
base-build:
4547
docker build $(ROOTPATH) \
4648
--file $(ROOTPATH)/docker/base/Dockerfile \
47-
--tag cybertec-pg-container/base:$(BASEOS)-$(BUILD) \
49+
--tag $(IMAGE_PATH)/base:$(BASEOS)-$(BUILD) \
4850
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
4951
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
5052
--build-arg BASEOS=$(BASEOS) \
@@ -56,7 +58,7 @@ base: base-build;
5658
pgbackrest-build:
5759
docker build $(ROOTPATH) \
5860
--file $(ROOTPATH)/docker/pgbackrest/Dockerfile \
59-
--tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG) \
61+
--tag $(REPOSITORY)/$(IMAGE_PATH)/pgbackrest:$(IMAGE_TAG) \
6062
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
6163
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
6264
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -74,7 +76,7 @@ pgbackrest: pgbackrest-build;
7476
postgres-build:
7577
docker build $(ROOTPATH) \
7678
--file $(ROOTPATH)/docker/postgres/Dockerfile \
77-
--tag cybertec-pg-container/postgres:$(IMAGE_TAG) \
79+
--tag $(REPOSITORY)/$(IMAGE_PATH)/postgres:$(IMAGE_TAG) \
7880
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
7981
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
8082
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -94,7 +96,7 @@ postgres: postgres-build
9496
postgres-gis-build:
9597
docker build $(ROOTPATH) \
9698
--file $(ROOTPATH)/docker/postgres-gis/Dockerfile \
97-
--tag cybertec-pg-container/postgres-gis:$(IMAGE_TAG) \
99+
--tag $(REPOSITORY)/$(IMAGE_PATH)/postgres-gis:$(POSTGIS_IMAGE_TAG) \
98100
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
99101
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
100102
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -115,7 +117,7 @@ postgres-gis: postgres-gis-build
115117
postgres-oracle-build:
116118
docker build $(ROOTPATH) \
117119
--file $(ROOTPATH)/docker/postgres-oracle/Dockerfile \
118-
--tag cybertec-pg-container/postgres-oracle:$(IMAGE_TAG) \
120+
--tag $(REPOSITORY)/$(IMAGE_PATH)/postgres-oracle:$(IMAGE_TAG) \
119121
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
120122
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
121123
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -135,7 +137,7 @@ postgres-oracle: postgres-oracle-build
135137
pgbouncer-build:
136138
docker build $(ROOTPATH) --no-cache \
137139
--file $(ROOTPATH)/docker/pgbouncer/Dockerfile \
138-
--tag cybertec-pg-container/pgbouncer:$(IMAGE_TAG) \
140+
--tag $(REPOSITORY)/$(IMAGE_PATH)/pgbouncer:$(PGBOUNCER_IMAGE_TAG) \
139141
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
140142
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
141143
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -151,7 +153,7 @@ pgbouncer: pgbouncer-build
151153
exporter-build:
152154
docker build $(ROOTPATH) --no-cache \
153155
--file $(ROOTPATH)/docker/exporter/Dockerfile \
154-
--tag cybertec-pg-container/exporter:$(IMAGE_TAG) \
156+
--tag $(REPOSITORY)/$(IMAGE_PATH)/exporter:$(IMAGE_TAG) \
155157
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
156158
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
157159
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -167,7 +169,7 @@ exporter: exporter-build
167169
publicbeta-pg-build:
168170
docker build $(ROOTPATH) \
169171
--file $(ROOTPATH)/docker/pg-public-beta/Dockerfile \
170-
--tag cybertec-pg-container/postgres:$(IMAGE_TAG)-beta${PUBLICBETA} \
172+
--tag $(REPOSITORY)/$(IMAGE_PATH)/postgres:$(IMAGE_TAG)-beta${PUBLICBETA} \
171173
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
172174
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
173175
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \
@@ -187,7 +189,7 @@ publicbeta-pg: publicbeta-pg-build
187189
publicbeta-pgbackrest-build:
188190
docker build $(ROOTPATH) \
189191
--file $(ROOTPATH)/docker/pgbackrest-public-beta/Dockerfile \
190-
--tag cybertec-pg-container/pgbackrest:$(IMAGE_TAG)-beta${PUBLICBETA} \
192+
--tag $(REPOSITORY)/$(IMAGE_PATH)/pgbackrest:$(IMAGE_TAG)-beta${PUBLICBETA} \
191193
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
192194
--build-arg CONTAINERIMAGE=${CONTAINERIMAGE} \
193195
--build-arg IMAGE_REPOSITORY=$(IMAGE_REPOSITORY) \

docker/exporter/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN ${PACKAGER} -y install --nodocs \
1515
make \
1616
&& ${PACKAGER} -y clean all ;
1717

18-
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
18+
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
1919
ENV PATH=$PATH:/usr/local/go/bin
2020

2121
RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter && make build;

docker/pgbackrest/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ COPY --from=builder /usr/bin/trust /usr/bin/
108108

109109
# libraries
110110
COPY --from=builder /usr/bin/nss_wrapper.pl /usr/bin/nss_wrapper.pl
111-
# COPY --from=builder /usr/lib64/libnss_wrapper.so /usr/lib64/libnss_wrapper.so
111+
COPY --from=builder /usr/lib64/libnss_wrapper.so /usr/lib64/libnss_wrapper.so
112112
COPY --from=builder /usr/share/man/man1 /usr/share/man/man1
113113
COPY --from=builder /usr/bin/envsubst /usr/bin/envsubst
114114

@@ -161,6 +161,10 @@ VOLUME ["sshd", "/home/postgres/pgdata", "/backrestrepo"]
161161

162162
ENTRYPOINT ["/scripts/nss_wrapper/nss_wrapper.sh"]
163163

164+
ENV LD_PRELOAD=/usr/lib64/libnss_wrapper.so \
165+
NSS_WRAPPER_PASSWD=/tmp/nss_wrapper/passwd \
166+
NSS_WRAPPER_GROUP=/tmp/nss_wrapper/group
167+
164168
USER postgres
165169

166170
CMD ["dumb-init", "/launch.sh", "init"]

docker/postgres-gis/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
7777
&& git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \
7878
&& git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \
7979
&& git clone https://github.com/dimitri/pgextwlist.git \
80-
&& git clone https://github.com/crunchydata/pgnodemx \
80+
# && git clone https://github.com/crunchydata/pgnodemx \
8181
\
8282
&& ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 postgresql${PGVERSION} libevent-devel brotli-devel libbrotli \
8383
&& ${PACKAGER} -y clean all \
@@ -94,7 +94,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
9494
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
9595
&& ${PACKAGER} -y install -y postgresql${version}-contrib \
9696
postgresql${version}-plpython3 postgresql${version}-devel \
97-
pg_cron_${version} pgvector_${version} set_user_${version} \
97+
pg_cron_${version} pgvector_${version} set_user_${version} pgnodemx_${version} \
9898
# Modify for using origial-spilo scripts
9999
&& ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \
100100
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \
@@ -106,8 +106,8 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
106106
&& for n in pg_permissions $EXTRA_EXTENSIONS; do \
107107
make -C $n USE_PGXS=1 clean install-strip; \
108108
done \
109-
&& cd /pgextwlist && make clean && make && make install \
110-
&& cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \
109+
&& cd /pgextwlist && make clean && make && make install; \
110+
# && cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \
111111
done \
112112
&& ${PACKAGER} -y install pgbackrest-${PGBACKREST_VERSION} \
113113
&& ${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
194194
&& chgrp -R 0 $PGHOME $RW_DIR \
195195
&& chmod -R g=u $PGHOME $RW_DIR \
196196
&& usermod -a -G root postgres; \
197-
fi
198-
197+
fi
199198

200199
COPY scripts bootstrap major_upgrade /scripts/
201200
COPY launcher/postgres/launch.sh /

docker/postgres/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
7676
&& git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \
7777
&& git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \
7878
&& git clone https://github.com/dimitri/pgextwlist.git \
79-
&& git clone https://github.com/crunchydata/pgnodemx \
79+
# && git clone https://github.com/crunchydata/pgnodemx \
8080
\
8181
&& ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 postgresql${PGVERSION} libevent-devel brotli-devel libbrotli \
8282
&& ${PACKAGER} -y clean all \
@@ -93,7 +93,7 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
9393
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
9494
&& ${PACKAGER} -y install -y postgresql${version}-contrib \
9595
postgresql${version}-plpython3 postgresql${version}-devel \
96-
pg_cron_${version} pgvector_${version} set_user_${version} \
96+
pg_cron_${version} pgvector_${version} set_user_${version} pgnodemx_${version} \
9797
# Modify for using origial-spilo scripts
9898
&& ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \
9999
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin \
@@ -103,8 +103,8 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
103103
&& for n in pg_permissions $EXTRA_EXTENSIONS; do \
104104
make -C $n USE_PGXS=1 clean install-strip; \
105105
done \
106-
&& cd /pgextwlist && make clean && make && make install \
107-
&& cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \
106+
&& cd /pgextwlist && make clean && make && make install; \
107+
# && cd /pgnodemx && make USE_PGXS=1 clean && make USE_PGXS=1 && make USE_PGXS=1 install; \
108108
done \
109109
&& ${PACKAGER} -y install pgbackrest-${PGBACKREST_VERSION} \
110110
&& ${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
191191
&& chgrp -R 0 $PGHOME $RW_DIR \
192192
&& chmod -R g=u $PGHOME $RW_DIR \
193193
&& usermod -a -G root postgres; \
194-
fi
195-
194+
fi
196195

197196
COPY scripts bootstrap major_upgrade /scripts/
198197
COPY launcher/postgres/launch.sh /

0 commit comments

Comments
 (0)