Skip to content

Commit

Permalink
Merge pull request #395 from ImreSamu/20240414_update_PostGIS3.5_debian
Browse files Browse the repository at this point in the history
Update to PostGIS 3.5 debian
  • Loading branch information
ImreSamu authored Oct 21, 2024
2 parents 46c5548 + 107288e commit 892e29b
Show file tree
Hide file tree
Showing 49 changed files with 232 additions and 90 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
postgres: [12, 13, 14, 15, 16, 17]
postgis: ['3.4']
postgis: ['3.5']
variant: [default, alpine]
include:
- postgres: 16
Expand All @@ -25,12 +25,6 @@ jobs:
- postgres: 17
postgis: master
variant: default
- postgres: 16
postgis: 3.5
variant: alpine
- postgres: 17
postgis: 3.5
variant: alpine

name: Build docker image for ${{ matrix.postgres }}-${{ matrix.postgis }} variant ${{ matrix.variant }}
runs-on: ubuntu-20.04
Expand Down
4 changes: 2 additions & 2 deletions 12-3.4/Dockerfile → 12-3.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM postgres:12-bullseye

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.pgdg110+1 spatial database extension with PostgreSQL 12 bullseye" \
org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 12 bullseye" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1
ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
6 changes: 3 additions & 3 deletions 12-3.4/alpine/Dockerfile → 12-3.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ARG BASE_IMAGE=postgres:12-alpine3.20
FROM ${BASE_IMAGE}

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 12 Alpine" \
org.opencontainers.image.description="PostGIS 3.5.0 spatial database extension with PostgreSQL 12 Alpine" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_VERSION 3.4.3
ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b
ENV POSTGIS_VERSION 3.5.0
ENV POSTGIS_SHA256 a47b8415ab88437390eba28e51b993cf0a2357057c277eea00378b8b76ab2316

RUN set -eux \
&& apk add --no-cache --virtual .fetch-deps \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions 13-3.4/Dockerfile → 13-3.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM postgres:13-bullseye

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.pgdg110+1 spatial database extension with PostgreSQL 13 bullseye" \
org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 13 bullseye" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1
ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
6 changes: 3 additions & 3 deletions 13-3.4/alpine/Dockerfile → 13-3.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ARG BASE_IMAGE=postgres:13-alpine3.20
FROM ${BASE_IMAGE}

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 13 Alpine" \
org.opencontainers.image.description="PostGIS 3.5.0 spatial database extension with PostgreSQL 13 Alpine" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_VERSION 3.4.3
ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b
ENV POSTGIS_VERSION 3.5.0
ENV POSTGIS_SHA256 a47b8415ab88437390eba28e51b993cf0a2357057c277eea00378b8b76ab2316

RUN set -eux \
&& apk add --no-cache --virtual .fetch-deps \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions 14-3.4/Dockerfile → 14-3.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM postgres:14-bullseye

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.pgdg110+1 spatial database extension with PostgreSQL 14 bullseye" \
org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 14 bullseye" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1
ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
6 changes: 3 additions & 3 deletions 14-3.4/alpine/Dockerfile → 14-3.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ARG BASE_IMAGE=postgres:14-alpine3.20
FROM ${BASE_IMAGE}

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 14 Alpine" \
org.opencontainers.image.description="PostGIS 3.5.0 spatial database extension with PostgreSQL 14 Alpine" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_VERSION 3.4.3
ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b
ENV POSTGIS_VERSION 3.5.0
ENV POSTGIS_SHA256 a47b8415ab88437390eba28e51b993cf0a2357057c277eea00378b8b76ab2316

RUN set -eux \
&& apk add --no-cache --virtual .fetch-deps \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions 15-3.4/Dockerfile → 15-3.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM postgres:15-bullseye

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.pgdg110+1 spatial database extension with PostgreSQL 15 bullseye" \
org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 15 bullseye" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1
ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
6 changes: 3 additions & 3 deletions 15-3.4/alpine/Dockerfile → 15-3.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ARG BASE_IMAGE=postgres:15-alpine3.20
FROM ${BASE_IMAGE}

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 15 Alpine" \
org.opencontainers.image.description="PostGIS 3.5.0 spatial database extension with PostgreSQL 15 Alpine" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_VERSION 3.4.3
ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b
ENV POSTGIS_VERSION 3.5.0
ENV POSTGIS_SHA256 a47b8415ab88437390eba28e51b993cf0a2357057c277eea00378b8b76ab2316

RUN set -eux \
&& apk add --no-cache --virtual .fetch-deps \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 28 additions & 3 deletions 16-3.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# placeholder Dockerfile
# Debian version of postgis is not detected!
# This is an autogenerated message of ./update.sh
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY.
#

FROM postgres:16-bullseye

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 16 bullseye" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
# fix: https://github.com/postgis/docker-postgis/issues/307
ca-certificates \
\
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
COPY ./update-postgis.sh /usr/local/bin

File renamed without changes.
File renamed without changes.
28 changes: 13 additions & 15 deletions 16-master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# This is a multi-stage Dockerfile, requiring a minimum Docker version of 17.05.

ARG DOCKER_CMAKE_BUILD_TYPE=Release
ARG CGAL_GIT_BRANCH=5.6.x-branch
ARG CGAL_GIT_BRANCH=master
FROM postgres:16-bullseye as builder

LABEL maintainer="PostGIS Project - https://postgis.net" \
Expand Down Expand Up @@ -84,18 +84,16 @@ ARG DOCKER_CMAKE_BUILD_TYPE
ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE}

# cgal & sfcgal
# By utilizing the latest commit of the CGAL 5.x.x-branch and implementing a header-only build for SFCGAL,
# one can benefit from the latest CGAL patches while avoiding compatibility issues.
ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL5X_GIT_HASH f1af52edeb741a05f86d959984ed943f25f5fcd4
ENV SFCGAL_GIT_HASH 88ec10481fc51efb4d232fd2f45bb556120a6f4c
ENV CGAL_GIT_HASH a98031649b4d9bd61ea2934204b523d0d8a9e633
ENV SFCGAL_GIT_HASH c92aa736e1f22422b8fd4ac6eba2e041b74d3a29
RUN set -ex \
&& mkdir -p /usr/src \
&& cd /usr/src \
&& git clone --branch ${CGAL_GIT_BRANCH} https://github.com/CGAL/cgal \
&& cd cgal \
&& git checkout ${CGAL5X_GIT_HASH} \
&& git checkout ${CGAL_GIT_HASH} \
&& git log -1 > /_pgis_cgal_last_commit.txt \
&& cd /usr/src \
&& git clone https://gitlab.com/SFCGAL/SFCGAL.git \
Expand All @@ -122,7 +120,7 @@ RUN set -ex \
&& rm -fr /usr/src/cgal

# proj
ENV PROJ_GIT_HASH d19ab643b9825bf4de5ff336e228b9abc06e2991
ENV PROJ_GIT_HASH 54a7662dbc52963da70303ac8c9124966f4cf6b4
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/PROJ.git \
Expand Down Expand Up @@ -152,7 +150,7 @@ RUN set -ex \
&& rm -fr /usr/src/PROJ

# geos
ENV GEOS_GIT_HASH e142764b77f4b8d0c36ec88406300c5f876743fb
ENV GEOS_GIT_HASH d7c51c401213d11f5dafd56596295274433379b6
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/libgeos/geos.git \
Expand All @@ -168,7 +166,7 @@ RUN set -ex \
&& rm -fr /usr/src/geos

# gdal
ENV GDAL_GIT_HASH 91bfec36a4dc03cfba554e6197a83099d9ec122a
ENV GDAL_GIT_HASH 014581eece0d174ac283691e855c5f370a73d990
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/gdal.git \
Expand Down Expand Up @@ -301,11 +299,11 @@ COPY --from=builder /usr/local /usr/local

ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL5X_GIT_HASH f1af52edeb741a05f86d959984ed943f25f5fcd4
ENV SFCGAL_GIT_HASH 88ec10481fc51efb4d232fd2f45bb556120a6f4c
ENV PROJ_GIT_HASH d19ab643b9825bf4de5ff336e228b9abc06e2991
ENV GEOS_GIT_HASH e142764b77f4b8d0c36ec88406300c5f876743fb
ENV GDAL_GIT_HASH 91bfec36a4dc03cfba554e6197a83099d9ec122a
ENV CGAL_GIT_HASH a98031649b4d9bd61ea2934204b523d0d8a9e633
ENV SFCGAL_GIT_HASH c92aa736e1f22422b8fd4ac6eba2e041b74d3a29
ENV PROJ_GIT_HASH 54a7662dbc52963da70303ac8c9124966f4cf6b4
ENV GEOS_GIT_HASH d7c51c401213d11f5dafd56596295274433379b6
ENV GDAL_GIT_HASH 014581eece0d174ac283691e855c5f370a73d990

# Minimal command line test ( fail fast )
RUN set -ex \
Expand All @@ -324,7 +322,7 @@ RUN set -ex \
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1

# install postgis
ENV POSTGIS_GIT_HASH b28f00c3efd772460714cb9db30b0dc9a0ff27fd
ENV POSTGIS_GIT_HASH 77bcee79332a82a5b5fc7ae6ae47470939a855fa

RUN set -ex \
&& apt-get update \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions 17-3.5/17-3.4/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

# Create the 'template_postgis' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_postgis IS_TEMPLATE true;
EOSQL

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
-- Reconnect to update pg_setting.resetval
-- See https://github.com/postgis/docker-postgis/issues/288
\c
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
28 changes: 28 additions & 0 deletions 17-3.5/17-3.4/update-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';
-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
-- Install Tiger dependencies in case not already installed
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
-- Upgrade US Tiger Geocoder
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_tiger_geocoder UPDATE TO '$POSTGIS_VERSION';
"
done
31 changes: 28 additions & 3 deletions 17-3.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# placeholder Dockerfile
# Debian version of postgis is not detected!
# This is an autogenerated message of ./update.sh
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY.
#

FROM postgres:17-bullseye

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.5.0+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 17 bullseye" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.5.0+dfsg-1.pgdg110+1

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
# fix: https://github.com/postgis/docker-postgis/issues/307
ca-certificates \
\
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
COPY ./update-postgis.sh /usr/local/bin

25 changes: 25 additions & 0 deletions 17-3.5/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

# Create the 'template_postgis' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_postgis IS_TEMPLATE true;
EOSQL

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
-- Reconnect to update pg_setting.resetval
-- See https://github.com/postgis/docker-postgis/issues/288
\c
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
28 changes: 28 additions & 0 deletions 17-3.5/update-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

POSTGIS_VERSION="${POSTGIS_VERSION%%+*}"

# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB" "${@}"; do
echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION"
psql --dbname="$DB" -c "
-- Upgrade PostGIS (includes raster)
CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION';
-- Upgrade Topology
CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION';
-- Install Tiger dependencies in case not already installed
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
-- Upgrade US Tiger Geocoder
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder VERSION '$POSTGIS_VERSION';
ALTER EXTENSION postgis_tiger_geocoder UPDATE TO '$POSTGIS_VERSION';
"
done
Loading

0 comments on commit 892e29b

Please sign in to comment.