Skip to content

Commit 620be10

Browse files
committed
build: halt build if PG can have a minor upgrade
When building a system image, we start from a community postgres image. There is the chance that newer postgres packages are released, and they could be upgraded when installing the supported extensions. We want to prevent this scenario, as it could lead to unexpected versions in the container image. Closes cloudnative-pg#186 Signed-off-by: Francesco Canovai <[email protected]>
1 parent 214e99e commit 620be10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Debian/Dockerfile.template

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ COPY requirements.txt /
3131
# Install additional extensions
3232
RUN set -xe; \
3333
apt-get update; \
34+
if apt list --upgradable 2>/dev/null | grep -q '^postgres'; then \
35+
echo "ERROR: Upgradable postgres packages found!"; \
36+
apt list --upgradable 2>/dev/null | grep '^postgres'; \
37+
exit 1; \
38+
fi; \
3439
apt-get install -y --no-install-recommends \
3540
"postgresql-${PG_MAJOR}-pgaudit" \
3641
"postgresql-${PG_MAJOR}-pgvector" \

0 commit comments

Comments
 (0)