Skip to content

Commit 1368c5b

Browse files
authored
build: halt build if PG can have a minor upgrade (#76)
When building the image, we start from a PostGIS community image. There is a chance that newer PostgreSQL packages are released after image release, and they could be upgraded installing extensions. We want to prevent this scenario, as it could lead to unexpected versions in the container image. Closes #75 Signed-off-by: Francesco Canovai <[email protected]>
1 parent 3d373cc commit 1368c5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

PostGIS/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}-pg-failover-slots" \

0 commit comments

Comments
 (0)