From 09c57349ee350f630821f03c49e36406e61beaed Mon Sep 17 00:00:00 2001 From: admire Date: Tue, 5 Jan 2021 19:09:48 +0200 Subject: [PATCH] Some minor tweaks --- Dockerfile | 3 ++- build.sh | 3 ++- docker-compose.yml | 4 ++-- scripts/env-data.sh | 3 ++- scripts/setup-conf.sh | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b7b55d..a9e5b0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ MAINTAINER Tim Sutton ARG IMAGE_VERSION ARG POSTGRES_MAJOR_VERSION=13 ARG POSTGIS_MAJOR=3 -ARG POSTGIS_MINOR_RELEASE=3.1 +ARG POSTGIS_MINOR_RELEASE=1 @@ -43,6 +43,7 @@ RUN set -eux \ RUN echo $POSTGRES_MAJOR_VERSION >/tmp/pg_version.txt +RUN echo $POSTGIS_MAJOR >/tmp/pg_major_version.txt RUN echo $POSTGIS_MINOR_RELEASE >/tmp/pg_minor_version.txt ENV \ PATH="$PATH:/usr/lib/postgresql/${POSTGRES_MAJOR_VERSION}/bin" diff --git a/build.sh b/build.sh index c07743e..72b1a0a 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash POSTGRES_MAJOR_VERSION=13 +POSTGIS_MINOR_RELEASE=1 cd base_build ./build.sh cd .. docker build -t kartoza/postgis:manual-build . -docker build --build-arg DISTRO=debian --build-arg IMAGE_VERSION=bullseye --build-arg IMAGE_VARIANT=slim -t kartoza/postgis:${POSTGRES_MAJOR_VERSION}.1 . +docker build --build-arg DISTRO=debian --build-arg IMAGE_VERSION=bullseye --build-arg IMAGE_VARIANT=slim -t kartoza/postgis:${POSTGRES_MAJOR_VERSION}.${POSTGIS_MINOR_RELEASE} . diff --git a/docker-compose.yml b/docker-compose.yml index 481a9f7..b2d2546 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ volumes: services: db: - image: kartoza/postgis:12.0 + image: kartoza/postgis:13.1 volumes: - postgis-data:/var/lib/postgresql - dbbackups:/backups @@ -26,7 +26,7 @@ services: test: "exit 0" dbbackups: - image: kartoza/pg-backup:12.0 + image: kartoza/pg-backup:13.0 hostname: pg-backups volumes: - dbbackups:/backups diff --git a/scripts/env-data.sh b/scripts/env-data.sh index ab562cc..c308ed8 100644 --- a/scripts/env-data.sh +++ b/scripts/env-data.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash POSTGRES_MAJOR_VERSION=$(cat /tmp/pg_version.txt) +POSTGIS_MAJOR=$(cat /tmp/pg_major_version.txt) POSTGIS_MINOR_RELEASE=$(cat /tmp/pg_minor_version.txt) DEFAULT_DATADIR="/var/lib/postgresql/${POSTGRES_MAJOR_VERSION}/main" ROOT_CONF="/etc/postgresql/${POSTGRES_MAJOR_VERSION}/main" @@ -9,7 +10,7 @@ WAL_ARCHIVE="/opt/archivedir" RECOVERY_CONF="$ROOT_CONF/recovery.conf" POSTGRES="/usr/lib/postgresql/${POSTGRES_MAJOR_VERSION}/bin/postgres" INITDB="/usr/lib/postgresql/${POSTGRES_MAJOR_VERSION}/bin/initdb" -SQLDIR="/usr/share/postgresql/${POSTGRES_MAJOR_VERSION}/contrib/postgis-$POSTGIS_MINOR_RELEASE/" +SQLDIR="/usr/share/postgresql/${POSTGRES_MAJOR_VERSION}/contrib/postgis-${POSTGIS_MAJOR}.${POSTGIS_MINOR_RELEASE}/" SETVARS="POSTGIS_ENABLE_OUTDB_RASTERS=1 POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL" LOCALONLY="-c listen_addresses='127.0.0.1'" PG_BASEBACKUP="/usr/bin/pg_basebackup" diff --git a/scripts/setup-conf.sh b/scripts/setup-conf.sh index d8e8f3a..1850cc4 100644 --- a/scripts/setup-conf.sh +++ b/scripts/setup-conf.sh @@ -10,16 +10,16 @@ fi # Refresh configuration in case environment settings changed. cat $CONF.template > $CONF -# Reflect DATADIR loaction +# Reflect DATA DIR location # Delete any data_dir declarations sed -i '/data_directory/d' $CONF -echo "data_directory = '${DATADIR}'" >> $CONF # Create a config to optimise postgis if [[ -f ${ROOT_CONF}/postgis.conf ]];then rm $CONF/postgis.conf fi cat >> ${ROOT_CONF}/postgis.conf <