Skip to content

Commit 0337a98

Browse files
authored
feat: update to trixie (#101)
Signed-off-by: Niccolò Fei <[email protected]>
1 parent d8ba087 commit 0337a98

File tree

4 files changed

+63
-60
lines changed

4 files changed

+63
-60
lines changed

.github/workflows/reusable-e2e.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,7 @@ defaults:
3737
# default failure handling for shell scripts in 'run' steps
3838
shell: 'bash -Eeuo pipefail -x {0}'
3939

40-
permissions:
41-
actions: none
42-
attestations: none
43-
checks: none
44-
contents: none
45-
deployments: none
46-
id-token: none
47-
issues: none
48-
models: none
49-
discussions: none
50-
packages: none
51-
pages: none
52-
pull-requests: none
53-
security-events: none
54-
statuses: none
40+
permissions: {}
5541

5642
jobs:
5743
e2e-local:
@@ -66,7 +52,8 @@ jobs:
6652
POSTGRES_VERSION: ${{ inputs.major_version }}
6753
POSTGRES_IMG: ${{ inputs.postgres_img }}
6854
POSTGRES_KIND: "PostgreSQL"
69-
MAJOR_UPGRADE_IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}/postgresql-trunk"
55+
POSTGRES_MAJOR_UPGRADE_IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}/postgresql-trunk"
56+
POSTGIS_MAJOR_UPGRADE_IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}/postgresql-trunk"
7057

7158
DOCKER_SERVER: ghcr.io
7259
DOCKER_USERNAME: ${{ github.actor }}

Dockerfile

Lines changed: 53 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,44 @@
1919
#
2020
ARG BASE=debian:13.1-slim
2121

22-
FROM $BASE AS build-layer
22+
FROM $BASE AS minimal
2323

2424
ARG PG_REPO=https://git.postgresql.org/git/postgresql.git
2525
ARG PG_BRANCH=master
2626
ARG PG_MAJOR=19
2727

2828
COPY build-deps.txt /
2929

30+
ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin:$PATH
31+
3032
# Install runtime and build dependencies
3133
RUN apt-get update && \
32-
apt-get install -y --no-install-recommends \
34+
apt-get install -y --no-install-recommends -o Dpkg::::="--force-confdef" -o Dpkg::::="--force-confold" \
3335
gnupg \
3436
dirmngr \
3537
ca-certificates \
3638
ssl-cert \
3739
libnss-wrapper \
3840
libgssapi-krb5-2 \
41+
libprotobuf-c1 \
42+
libnuma1 \
43+
liburing2 \
3944
libxml2 \
40-
libllvm16 \
45+
libllvm19 \
4146
libxslt1.1 \
4247
xz-utils \
4348
zstd \
49+
libicu76 \
4450
postgresql-common \
45-
$(cat /build-deps.txt) && \
46-
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*
47-
48-
RUN usermod -u 26 postgres
49-
50-
ENV PG_MAJOR=$PG_MAJOR
51-
ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin:$PATH
52-
53-
# Build PostgreSQL
54-
# Partially refer to https://github.com/docker-library/postgres/blob/master/16/alpine3.21/Dockerfile#L119-L159
55-
RUN mkdir -p /usr/src/postgresql && \
51+
$(cat /build-deps.txt) \
52+
&& \
53+
usermod -u 26 postgres && \
54+
# Build PostgreSQL
55+
mkdir -p /usr/src/postgresql && \
5656
git clone -b "$PG_BRANCH" --single-branch "$PG_REPO" /usr/src/postgresql && \
5757
cd /usr/src/postgresql && \
58-
export LLVM_CONFIG="/usr/lib/llvm-16/bin/llvm-config" && \
59-
export CLANG=clang-16 && \
58+
export LLVM_CONFIG="/usr/lib/llvm-19/bin/llvm-config" && \
59+
export CLANG=clang-19 && \
6060
./configure \
6161
--build=x86_64-linux-gnu \
6262
--prefix=/usr \
@@ -86,6 +86,8 @@ RUN mkdir -p /usr/src/postgresql && \
8686
--with-systemd \
8787
--with-selinux \
8888
--with-zstd \
89+
--with-liburing \
90+
--with-libnuma \
8991
--with-extra-version=-$(git rev-parse --short HEAD) \
9092
--datarootdir=/usr/share/ \
9193
--infodir=/usr/share/info \
@@ -105,46 +107,59 @@ RUN mkdir -p /usr/src/postgresql && \
105107
&& \
106108
make -j "$(nproc)" world-bin && \
107109
make install-world-bin && \
108-
rm -rf /usr/src/postgresql
109-
110-
# DoD 2.3 - remove setuid/setgid from any binary that not strictly requires it, and before doing that list them on the stdout
111-
RUN find / -not -path "/proc/*" -perm /6000 -type f -exec ls -ld {} \; -exec chmod a-s {} \; || true
110+
apt-get purge -y --auto-remove $(cat /build-deps.txt) && \
111+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
112+
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/* /usr/src/postgresql
112113

113-
114-
FROM build-layer AS minimal
115-
RUN apt-get purge -y --auto-remove $(cat /build-deps.txt) && \
116-
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*
117114
USER 26
118115

119-
FROM build-layer AS standard
120-
# TODO: re-enable once https://github.com/pgaudit/pgaudit/issues/257 is fixed
116+
FROM minimal AS standard
117+
USER root
118+
121119
# Build PgAudit
122120
# See to https://github.com/pgaudit/pgaudit/blob/master/README.md#compile-and-install
123-
# RUN mkdir -p /usr/src/pgaudit && \
121+
# TODO: uncomment when https://github.com/pgaudit/pgaudit/issues/257 is fixed
122+
#RUN apt-get update && \
123+
# apt-get install -y --no-install-recommends \
124+
# build-essential \
125+
# git \
126+
# libssl-dev \
127+
# libkrb5-dev \
128+
# && \
129+
# mkdir -p /usr/src/pgaudit && \
124130
# git clone -b main --single-branch https://github.com/pgaudit/pgaudit.git /usr/src/pgaudit && \
125131
# cd /usr/src/pgaudit && \
126132
# make install USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/$PG_MAJOR/bin/pg_config && \
127-
# rm -rf /usr/src/pgaudit
133+
# apt-get purge -y --auto-remove \
134+
# build-essential \
135+
# git \
136+
# libssl-dev \
137+
# libkrb5-dev \
138+
# && \
139+
# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
140+
# rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/* /usr/src/pgaudit
128141

129142
# Install all locales
130143
RUN apt-get update && \
131-
apt-get install -y --no-install-recommends locales-all
132-
133-
RUN apt-get purge -y --auto-remove $(cat /build-deps.txt) && \
144+
apt-get install -y --no-install-recommends locales-all && \
134145
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*
146+
135147
USER 26
136148

137-
FROM build-layer AS postgis
149+
FROM standard AS postgis
150+
USER root
138151
ARG POSTGIS_REPO=https://github.com/postgis/postgis.git
139152
ARG POSTGIS_BRANCH=master
140153

141154
RUN apt-get update && \
142155
apt-get install -y --no-install-recommends \
156+
$(cat /build-deps.txt) \
157+
# runtime deps
143158
libproj25 \
144159
libpq5 \
145-
libgdal32 \
146-
libgeos-c1v5 \
147-
libsfcgal1 \
160+
libgdal36 \
161+
libgeos-c1t64 \
162+
libsfcgal2 \
148163
&& \
149164
mkdir -p /usr/src/postgis && \
150165
git clone -b "$POSTGIS_BRANCH" --single-branch "$POSTGIS_REPO" /usr/src/postgis && \
@@ -153,8 +168,8 @@ RUN apt-get update && \
153168
./configure --with-pgconfig=/usr/lib/postgresql/$PG_MAJOR/bin/pg_config --with-sfcgal && \
154169
make -j$(nproc) && \
155170
make install && \
156-
rm -rf /usr/src/postgis
171+
apt-get purge -y --auto-remove $(cat /build-deps.txt) && \
172+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
173+
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/* /usr/src/postgis
157174

158-
RUN apt-get purge -y --auto-remove $(cat /build-deps.txt) && \
159-
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*
160175
USER 26

build-deps.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
autoconf
22
automake
33
bison
4-
libjson-c-dev
54
build-essential
6-
clang-16
5+
clang-19
76
cmake
8-
docbook-xml
97
docbook5-xml
8+
docbook-xml
109
flex
1110
gettext
1211
git
@@ -18,11 +17,12 @@ libgdal-dev
1817
libgeos-dev
1918
libgmp-dev
2019
libipc-run-perl
20+
libjson-c-dev
2121
libkrb5-dev
2222
libldap-dev
2323
liblz4-dev
24+
libnuma-dev
2425
libpam0g-dev
25-
libpcre3-dev
2626
libperl-dev
2727
libproj-dev
2828
libprotobuf-c-dev
@@ -34,10 +34,11 @@ libssl-dev
3434
libsystemd-dev
3535
libtiff-dev
3636
libtool
37+
liburing-dev
3738
libxml2-utils
3839
libxslt1-dev
3940
libzstd-dev
40-
llvm-16-dev
41+
llvm-19-dev
4142
pkg-config
4243
protobuf-c-compiler
4344
python3-dev

defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"PG_IMAGE": "ghcr.io/cloudnative-pg/postgresql-trunk:19-minimal-bookworm",
2+
"PG_IMAGE": "ghcr.io/cloudnative-pg/postgresql-trunk:19-minimal-trixie",
33
"PG_MAJOR": 19,
44
"CNPG_BRANCH": "main",
55
"TEST_DEPTH": 4,

0 commit comments

Comments
 (0)