Skip to content

Commit d665d8a

Browse files
authored
Merge pull request #66 from cybertec-postgresql/UpdatePackages
Update packages
2 parents 5729407 + 97d73a8 commit d665d8a

File tree

6 files changed

+54
-31
lines changed

6 files changed

+54
-31
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

22
# Define Default if Values not exist
3-
BASE_IMAGE ?= rockylinux:9
3+
BASE_IMAGE ?= rockylinux/rockylinux:9
44
BASEOS ?= rocky9
55
CONTAINERIMAGE ?= rockylinux/rockylinux:9-ubi-micro
66
IMAGE_REPOSITORY ?= docker.io
77
IMAGE_PATH ?= cybertec-pg-container
88
PGVERSION ?= 17
9-
PGVERSION_FULL ?= 17.4
9+
PGVERSION_FULL ?= 17.6
1010
OLD_PG_VERSIONS ?= 13 14 15 16
1111
PATRONI_VERSION ?= multisite-4.0.5.1
12-
PGBACKREST_VERSION ?= 2.55.0
12+
PGBACKREST_VERSION ?= 2.56.0
1313
POSTGIS_VERSION ?= 35
14-
ETCD_VERSION ?= 3.5.21
14+
ETCD_VERSION ?= 3.6.4
1515
PGBOUNCER_VERSION ?= 1.24
1616
PACKAGER ?= dnf
1717
BUILD ?= 1
@@ -20,8 +20,8 @@ IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD)
2020
POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD)
2121

2222
# Public-Beta
23-
PUBLICBETA ?= 2
24-
BETAVERSION ?= 17
23+
PUBLICBETA ?= 3
24+
BETAVERSION ?= 18
2525

2626
# Settings for the Build-Process
2727
BUILDWITH ?= docker

docker/base/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG BASE_IMAGE
22
ARG IMAGE_REPOSITORY
33
ARG PATH
4+
ARG BASEOS
45
FROM $BASE_IMAGE
56

67
ARG PACKAGER
@@ -9,7 +10,6 @@ MAINTAINER CYBERTEC PostgreSQL International GmbH
910
LABEL vendor="CYBERTEC PostgreSQL International GmbH" url="https://www.cybertec-postgresql.com"
1011
LABEL maintainer="Matthias Groemmer <matthias.groemmer@cybertec.at>"
1112

12-
RUN ${PACKAGER} -y install --nodocs https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm vim && ${PACKAGER} -y upgrade
1313

1414
RUN ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
1515
bind-utils \
@@ -23,14 +23,15 @@ RUN ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
2323
glibc-langpack-en \
2424
openssh-clients \
2525
openssh-server \
26+
dnf-plugin-config-manager \
2627
&& ${PACKAGER} -y clean all ;
2728

2829
#Enable CRB-Repo (Powertools)
2930
RUN ${PACKAGER} -y config-manager --set-enabled crb
31+
#Add Epel
32+
RUN ${PACKAGER} -y install --nodocs https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E %{rhel}).noarch.rpm vim && ${PACKAGER} -y upgrade
3033
#Add PostgreSQL-Repo to Base
31-
RUN ${PACKAGER} --nodocs --noplugins --setopt=install_weak_deps=0 install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-$(uname -i)/pgdg-redhat-repo-latest.noarch.rpm && ${PACKAGER} -y update && ${PACKAGER} -y clean all
32-
RUN ${PACKAGER} -qy module disable postgresql
33-
34-
35-
36-
34+
RUN ${PACKAGER} --nodocs --noplugins --setopt=install_weak_deps=0 install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-$(uname -m)/pgdg-redhat-repo-latest.noarch.rpm && ${PACKAGER} -y update && ${PACKAGER} -y clean all
35+
RUN if [ "$BASEOS" = "rocky9" ]; then \
36+
${PACKAGER} -qy module disable postgresql; \
37+
fi

docker/exporter/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ RUN ${PACKAGER} -y install --nodocs \
1515
make \
1616
&& ${PACKAGER} -y clean all ;
1717

18-
RUN wget https://go.dev/dl/go1.23.6.linux-amd64.tar.gz && tar -xzf go1.23.6.linux-amd64.tar.gz && mv go /usr/local
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
1919
ENV PATH=$PATH:/usr/local/go/bin
2020

21-
RUN git clone https://github.com/cybertec-postgresql/postgres_exporter.git && cd postgres_exporter && make build;
21+
RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter && make build;
2222

2323
FROM ${CONTAINERIMAGE}
2424
COPY --from=builder /usr/bin/dumb-init /usr/bin/dumb-init

docker/pg-public-beta/Dockerfile

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ ARG ARCH
1818

1919
# Enable Beta-Repo
2020
RUN ${PACKAGER} config-manager --set-enabled pgdg${PGVERSION}-updates-testing \
21-
&& ${PACKAGER} config-manager --set-enabled pgdg${PGVERSION}-source-updates-testing;
21+
&& ${PACKAGER} config-manager --set-enabled pgdg${PGVERSION}-updates-testing-source;
22+
23+
# Spilo-specific
24+
ENV PAM_OAUTH2=v1.0.1 \
25+
PG_PERMISSIONS=REL_1_3
2226

2327
# Get some Standard-Stuff
2428
RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
@@ -33,12 +37,12 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop
3337
python3-pip \
3438
python3-psycopg2 \
3539
git \
36-
clang \
3740
patchutils \
3841
binutils \
3942
make \
4043
cmake \
4144
gcc \
45+
clang \
4246
pam-devel \
4347
wget \
4448
mlocate \
@@ -53,6 +57,8 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop
5357
dumb-init \
5458
libicu \
5559
pgbackrest-${PGBACKREST_VERSION} \
60+
cronie \
61+
libcurl-devel \
5662
&& ${PACKAGER} -y clean all;
5763

5864
# install etcdctl
@@ -61,12 +67,27 @@ RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/et
6167
ENV PATHBACKUP = $PATH
6268

6369
RUN wget https://smarden.org/runit/runit-2.1.2.tar.gz -P /package/
64-
65-
RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python-etcd psutil requests cdiff ydiff --upgrade \
66-
&& pip3 install patroni[kubernetes$EXTRAS]==$PATRONI_VERSION --upgrade \
70+
COPY cron_unprivileged.c /package/
71+
72+
RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python-etcd psutil requests cdiff ydiff==1.4.2 --upgrade \
73+
&& if [[ $PATRONI_VERSION == "multisite-"* ]]; then \
74+
git clone -b $PATRONI_VERSION https://github.com/cybertec-postgresql/patroni; \
75+
pip3 install ./patroni[kubernetes,etcd,etcd3]; \
76+
else \
77+
pip3 install patroni[kubernetes$EXTRAS]==$PATRONI_VERSION --upgrade; \
78+
fi \
6779
&& mkdir /usr/lib/postgresql \
80+
# Install pam_oauth2.so
81+
&& git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git && make -C pam-oauth2 install \
82+
&& git clone -b $PG_PERMISSIONS https://github.com/cybertec-postgresql/pg_permissions.git \
83+
&& git clone https://github.com/dimitri/pgextwlist.git \
84+
&& git clone https://github.com/crunchydata/pgnodemx \
85+
\
6886
&& ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 postgresql${PGVERSION} libevent-devel brotli-devel libbrotli \
6987
&& ${PACKAGER} -y clean all \
88+
\
89+
# forbid creation of a main cluster when package is installed
90+
#&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
7091
\
7192
# Install PostgreSQL
7293
&& for version in $PG_SUPPORTED_VERSIONS; do \
@@ -75,18 +96,18 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
7596
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
7697
&& ${PACKAGER} -y install -y postgresql${version}-contrib \
7798
postgresql${version}-devel \
78-
\
7999
# Modify for using origial-spilo scripts
80100
&& ln -s /usr/pgsql-${version} /usr/lib/postgresql/${version} \
81-
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin; \
101+
&& export PATH=$PATHBACKUP:/usr/pgsql-${version}/bin; \
82102
done \
83103
&& ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-static \
84104
&& ${PACKAGER} -y clean all;
105+
RUN gcc -s -shared -fPIC -o /usr/local/lib/cron_unprivileged.so /package/cron_unprivileged.c
85106

86107
RUN cd /package && tar -xvzf runit-2.1.2.tar.gz && rm runit-2.1.2.tar.gz \
87108
&& cd admin/runit-2.1.2 && package/install \
88109
&& ln -s /usr/local/bin/runsvdir /usr/bin/runsvdir \
89-
&& rm -rf /pg_permissions* /pgextwlist /pg_stat_kcache /pgnodemx /timescaledb /set_user /pam-oauth2 \
110+
&& rm -rf /pg_permissions /pgextwlist /pg_stat_kcache /pgnodemx /timescaledb /pam-oauth2 \
90111
&& rm /etc/pgbackrest.conf && rm -rf /var/spool/pgbackrest \
91112
&& ${PACKAGER} -y remove $(rpm -qa "*devel*") python3-pip python3-wheel python3-dev python3-setuptools git patchutils flatpak glibc-static gcc glibc-devel \
92113
&& ${PACKAGER} -y autoremove \
@@ -131,6 +152,7 @@ RUN rm -rf /etc/service && mkdir /home/postgres/pgdata && chown -R postgres:post
131152
chmod 755 $d/* \
132153
&& ln -s /run/supervise/$(basename $d) $d/supervise; \
133154
done \
155+
&& chmod +r /etc/motd \
134156
&& ln -snf $RW_DIR/service /etc/service \
135157
#&& ln -s $RW_DIR/pam.d-postgresql /etc/pam.d/postgresql \
136158
&& ln -s $RW_DIR/postgres.yml $PGHOME/postgres.yml \
@@ -149,7 +171,7 @@ RUN rm -rf /etc/service && mkdir /home/postgres/pgdata && chown -R postgres:post
149171
do echo "export $e" >> /etc/bash.bashrc; \
150172
done \
151173
&& ln -s /etc/skel/.bashrc $PGHOME/.bashrc \
152-
&& echo "source /etc/motd" >> /root/.bashrc \
174+
&& echo "source /etc/motd" >> /home/postgres/.bashrc \
153175
# Allow users in the root group to access the following files and dirs
154176
&& if [ "$COMPRESS" != "true" ]; then \
155177
chmod 664 /etc/passwd \
@@ -165,6 +187,6 @@ COPY launcher/postgres/launch.sh /
165187

166188
ENTRYPOINT ["/scripts/nss_wrapper/nss_wrapper.sh"]
167189

168-
USER 26
190+
USER postgres
169191

170-
CMD ["/bin/sh", "/launch.sh", "init"]
192+
CMD ["/bin/sh", "/launch.sh", "init"]

docker/pgbackrest-public-beta/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ ARG PGBACKREST_VERSION
1111
ARG PGVERSION
1212
ARG OLD_PG_VERSIONS
1313
ARG PG_SUPPORTED_VERSIONS="$OLD_PG_VERSIONS $PGVERSION"
14+
ARG ARCH
1415

1516
# Enable Beta-Repo
1617
RUN ${PACKAGER} config-manager --set-enabled pgdg${PGVERSION}-updates-testing \
17-
&& ${PACKAGER} config-manager --set-enabled pgdg${PGVERSION}-source-updates-testing \
18-
&& ${PACKAGER} -y update;
18+
&& ${PACKAGER} config-manager --set-enabled pgdg${PGVERSION}-updates-testing-source;
1919

2020
RUN ${PACKAGER} -y install --nodocs \
2121
--setopt=skip_missing_names_on_install=False \
@@ -42,7 +42,7 @@ RUN rm /etc/pgbackrest.conf
4242
RUN rm -rf /var/spool/pgbackrest
4343

4444
# Add kubectl
45-
RUN curl -LO https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubectl && chmod +x kubectl
45+
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl" && chmod +x kubectl
4646

4747
RUN mkdir -p /tmp/pgsql && cp -r /usr/pgsql* /tmp/pgsql
4848
RUN mkdir -p /tmp/pg && cp -r /usr/bin/pg* /tmp/pg
@@ -158,6 +158,6 @@ VOLUME ["sshd", "/home/postgres/pgdata", "/backrestrepo"]
158158

159159
ENTRYPOINT ["/scripts/nss_wrapper/nss_wrapper.sh"]
160160

161-
USER 26
161+
USER postgres
162162

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

docker/pgbackrest/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN ${PACKAGER} -y install --nodocs \
2424
dumb-init \
2525
jq \
2626
pgbackrest-${PGBACKREST_VERSION} \
27-
&& ${PACKAGER} -y clean all ;
27+
&& ${PACKAGER} -y clean all;
2828

2929
# Install postgres-server
3030
RUN ${PACKAGER} -y update \

0 commit comments

Comments
 (0)