diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60090e02..4458dd6b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,24 +15,21 @@ jobs: make-docker-images: strategy: matrix: - postgres: [12, 13, 14, 15, 16] + postgres: [12, 13, 14, 15, 16, 17] postgis: ['3.4'] variant: [default, alpine] include: - - postgres: 15 - postgis: master - variant: default - postgres: 16 postgis: master variant: default - - postgres: 17rc1 + - postgres: 17 postgis: master variant: default - postgres: 16 - postgis: 3.5.0alpha2 + postgis: 3.5 variant: alpine - - postgres: 17rc1 - postgis: 3.5.0alpha2 + - postgres: 17 + postgis: 3.5 variant: alpine name: Build docker image for ${{ matrix.postgres }}-${{ matrix.postgis }} variant ${{ matrix.variant }} diff --git a/12-3.4/Dockerfile b/12-3.4/Dockerfile index cc7dcce9..369d4dd4 100644 --- a/12-3.4/Dockerfile +++ b/12-3.4/Dockerfile @@ -5,11 +5,11 @@ FROM postgres:12-bullseye LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.4.2+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 12 bullseye" \ + org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.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.2+dfsg-1.pgdg110+1 +ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ diff --git a/12-3.4/alpine/Dockerfile b/12-3.4/alpine/Dockerfile index bfb3a972..e48dc1df 100644 --- a/12-3.4/alpine/Dockerfile +++ b/12-3.4/alpine/Dockerfile @@ -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.2 spatial database extension with PostgreSQL 12 Alpine" \ + org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 12 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.4.2 -ENV POSTGIS_SHA256 17aa8760a5c4fcb9a1fdc750c1c9aca0198a35dd1e320628064c43f178eefed2 +ENV POSTGIS_VERSION 3.4.3 +ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/13-3.4/Dockerfile b/13-3.4/Dockerfile index d85e223c..b2214945 100644 --- a/13-3.4/Dockerfile +++ b/13-3.4/Dockerfile @@ -5,11 +5,11 @@ FROM postgres:13-bullseye LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.4.2+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 13 bullseye" \ + org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.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.2+dfsg-1.pgdg110+1 +ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ diff --git a/13-3.4/alpine/Dockerfile b/13-3.4/alpine/Dockerfile index faf73cc6..242ddb4d 100644 --- a/13-3.4/alpine/Dockerfile +++ b/13-3.4/alpine/Dockerfile @@ -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.2 spatial database extension with PostgreSQL 13 Alpine" \ + org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 13 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.4.2 -ENV POSTGIS_SHA256 17aa8760a5c4fcb9a1fdc750c1c9aca0198a35dd1e320628064c43f178eefed2 +ENV POSTGIS_VERSION 3.4.3 +ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/14-3.4/Dockerfile b/14-3.4/Dockerfile index 36e46768..c45a2fb9 100644 --- a/14-3.4/Dockerfile +++ b/14-3.4/Dockerfile @@ -5,11 +5,11 @@ FROM postgres:14-bullseye LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.4.2+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 14 bullseye" \ + org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.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.2+dfsg-1.pgdg110+1 +ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ diff --git a/14-3.4/alpine/Dockerfile b/14-3.4/alpine/Dockerfile index 6caa6f6b..e2b1ea21 100644 --- a/14-3.4/alpine/Dockerfile +++ b/14-3.4/alpine/Dockerfile @@ -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.2 spatial database extension with PostgreSQL 14 Alpine" \ + org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 14 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.4.2 -ENV POSTGIS_SHA256 17aa8760a5c4fcb9a1fdc750c1c9aca0198a35dd1e320628064c43f178eefed2 +ENV POSTGIS_VERSION 3.4.3 +ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/15-3.4/Dockerfile b/15-3.4/Dockerfile index acada43f..90c865ad 100644 --- a/15-3.4/Dockerfile +++ b/15-3.4/Dockerfile @@ -5,11 +5,11 @@ FROM postgres:15-bullseye LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.4.2+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 15 bullseye" \ + org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.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.2+dfsg-1.pgdg110+1 +ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ diff --git a/15-3.4/alpine/Dockerfile b/15-3.4/alpine/Dockerfile index 9c27367d..a21354de 100644 --- a/15-3.4/alpine/Dockerfile +++ b/15-3.4/alpine/Dockerfile @@ -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.2 spatial database extension with PostgreSQL 15 Alpine" \ + org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 15 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.4.2 -ENV POSTGIS_SHA256 17aa8760a5c4fcb9a1fdc750c1c9aca0198a35dd1e320628064c43f178eefed2 +ENV POSTGIS_VERSION 3.4.3 +ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/16-3.4/Dockerfile b/16-3.4/Dockerfile index e30d89da..5184a329 100644 --- a/16-3.4/Dockerfile +++ b/16-3.4/Dockerfile @@ -5,11 +5,11 @@ FROM postgres:16-bullseye LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.4.2+dfsg-1.pgdg110+1 spatial database extension with PostgreSQL 16 bullseye" \ + org.opencontainers.image.description="PostGIS 3.4.3+dfsg-2.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.4.2+dfsg-1.pgdg110+1 +ENV POSTGIS_VERSION 3.4.3+dfsg-2.pgdg110+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ diff --git a/16-3.4/alpine/Dockerfile b/16-3.4/alpine/Dockerfile index ffc4b23e..620eda77 100644 --- a/16-3.4/alpine/Dockerfile +++ b/16-3.4/alpine/Dockerfile @@ -5,11 +5,11 @@ ARG BASE_IMAGE=postgres:16-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.4.2 spatial database extension with PostgreSQL 16 Alpine" \ + org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 16 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.4.2 -ENV POSTGIS_SHA256 17aa8760a5c4fcb9a1fdc750c1c9aca0198a35dd1e320628064c43f178eefed2 +ENV POSTGIS_VERSION 3.4.3 +ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/16-3.5.0alpha2/Dockerfile b/16-3.5/Dockerfile similarity index 100% rename from 16-3.5.0alpha2/Dockerfile rename to 16-3.5/Dockerfile diff --git a/16-3.5.0alpha2/alpine/Dockerfile b/16-3.5/alpine/Dockerfile similarity index 95% rename from 16-3.5.0alpha2/alpine/Dockerfile rename to 16-3.5/alpine/Dockerfile index 19044463..fbbdc2fe 100644 --- a/16-3.5.0alpha2/alpine/Dockerfile +++ b/16-3.5/alpine/Dockerfile @@ -5,11 +5,11 @@ ARG BASE_IMAGE=postgres:16-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.5.0alpha2 spatial database extension with PostgreSQL 16 Alpine" \ + org.opencontainers.image.description="PostGIS 3.5.0 spatial database extension with PostgreSQL 16 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.5.0alpha2 -ENV POSTGIS_SHA256 27c69b0f3d0a1329897060fb5e8345162d960f30b95f8903e98356fb3236427f +ENV POSTGIS_VERSION 3.5.0 +ENV POSTGIS_SHA256 a47b8415ab88437390eba28e51b993cf0a2357057c277eea00378b8b76ab2316 RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/15-master/initdb-postgis.sh b/16-3.5/alpine/initdb-postgis.sh similarity index 100% rename from 15-master/initdb-postgis.sh rename to 16-3.5/alpine/initdb-postgis.sh diff --git a/15-master/update-postgis.sh b/16-3.5/alpine/update-postgis.sh similarity index 100% rename from 15-master/update-postgis.sh rename to 16-3.5/alpine/update-postgis.sh diff --git a/16-master/Dockerfile b/16-master/Dockerfile index e357df2d..aaa3ebe9 100644 --- a/16-master/Dockerfile +++ b/16-master/Dockerfile @@ -89,7 +89,7 @@ ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} ARG CGAL_GIT_BRANCH ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH} ENV CGAL5X_GIT_HASH f1af52edeb741a05f86d959984ed943f25f5fcd4 -ENV SFCGAL_GIT_HASH 3a493846b779ded5ac87b8a7b37e8c119d4208c2 +ENV SFCGAL_GIT_HASH 88ec10481fc51efb4d232fd2f45bb556120a6f4c RUN set -ex \ && mkdir -p /usr/src \ && cd /usr/src \ @@ -122,7 +122,7 @@ RUN set -ex \ && rm -fr /usr/src/cgal # proj -ENV PROJ_GIT_HASH 0a407325fbb5bf42407a7dc5d4f948be9707e302 +ENV PROJ_GIT_HASH d19ab643b9825bf4de5ff336e228b9abc06e2991 RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/PROJ.git \ @@ -152,7 +152,7 @@ RUN set -ex \ && rm -fr /usr/src/PROJ # geos -ENV GEOS_GIT_HASH 701c868fa9ad8e82a3aa43f0bd19ec2003722f45 +ENV GEOS_GIT_HASH e142764b77f4b8d0c36ec88406300c5f876743fb RUN set -ex \ && cd /usr/src \ && git clone https://github.com/libgeos/geos.git \ @@ -168,7 +168,7 @@ RUN set -ex \ && rm -fr /usr/src/geos # gdal -ENV GDAL_GIT_HASH 6a5ab0e588d17b8cc9ee16c212407c0bd3f05a9b +ENV GDAL_GIT_HASH 91bfec36a4dc03cfba554e6197a83099d9ec122a RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/gdal.git \ @@ -302,10 +302,10 @@ 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 3a493846b779ded5ac87b8a7b37e8c119d4208c2 -ENV PROJ_GIT_HASH 0a407325fbb5bf42407a7dc5d4f948be9707e302 -ENV GEOS_GIT_HASH 701c868fa9ad8e82a3aa43f0bd19ec2003722f45 -ENV GDAL_GIT_HASH 6a5ab0e588d17b8cc9ee16c212407c0bd3f05a9b +ENV SFCGAL_GIT_HASH 88ec10481fc51efb4d232fd2f45bb556120a6f4c +ENV PROJ_GIT_HASH d19ab643b9825bf4de5ff336e228b9abc06e2991 +ENV GEOS_GIT_HASH e142764b77f4b8d0c36ec88406300c5f876743fb +ENV GDAL_GIT_HASH 91bfec36a4dc03cfba554e6197a83099d9ec122a # Minimal command line test ( fail fast ) RUN set -ex \ @@ -324,7 +324,7 @@ RUN set -ex \ || echo "ogr2ogr missing PostgreSQL driver" && exit 1 # install postgis -ENV POSTGIS_GIT_HASH 8349e1670aa4f273dd68813813a1a37b59c12a8c +ENV POSTGIS_GIT_HASH b28f00c3efd772460714cb9db30b0dc9a0ff27fd RUN set -ex \ && apt-get update \ diff --git a/17-3.4/Dockerfile b/17-3.4/Dockerfile new file mode 100644 index 00000000..bfa1eff7 --- /dev/null +++ b/17-3.4/Dockerfile @@ -0,0 +1,28 @@ +# +# 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.4.3+dfsg-2.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.4.3+dfsg-2.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 + diff --git a/17rc1-3.5.0alpha2/alpine/Dockerfile b/17-3.4/alpine/Dockerfile similarity index 94% rename from 17rc1-3.5.0alpha2/alpine/Dockerfile rename to 17-3.4/alpine/Dockerfile index 8cc7fb75..d3eb8aeb 100644 --- a/17rc1-3.5.0alpha2/alpine/Dockerfile +++ b/17-3.4/alpine/Dockerfile @@ -1,15 +1,15 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:17rc1-alpine3.20 +ARG BASE_IMAGE=postgres:17-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS 3.5.0alpha2 spatial database extension with PostgreSQL 17rc1 Alpine" \ + org.opencontainers.image.description="PostGIS 3.4.3 spatial database extension with PostgreSQL 17 Alpine" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" -ENV POSTGIS_VERSION 3.5.0alpha2 -ENV POSTGIS_SHA256 27c69b0f3d0a1329897060fb5e8345162d960f30b95f8903e98356fb3236427f +ENV POSTGIS_VERSION 3.4.3 +ENV POSTGIS_SHA256 802e1626252d12ec1d29261b95bf62930e1859587e44cad28d65b897a8d9ee6b RUN set -eux \ && apk add --no-cache --virtual .fetch-deps \ diff --git a/16-3.5.0alpha2/alpine/initdb-postgis.sh b/17-3.4/alpine/initdb-postgis.sh similarity index 100% rename from 16-3.5.0alpha2/alpine/initdb-postgis.sh rename to 17-3.4/alpine/initdb-postgis.sh diff --git a/16-3.5.0alpha2/alpine/update-postgis.sh b/17-3.4/alpine/update-postgis.sh similarity index 100% rename from 16-3.5.0alpha2/alpine/update-postgis.sh rename to 17-3.4/alpine/update-postgis.sh diff --git a/17rc1-3.5.0alpha2/alpine/initdb-postgis.sh b/17-3.4/initdb-postgis.sh similarity index 100% rename from 17rc1-3.5.0alpha2/alpine/initdb-postgis.sh rename to 17-3.4/initdb-postgis.sh diff --git a/17rc1-3.5.0alpha2/alpine/update-postgis.sh b/17-3.4/update-postgis.sh similarity index 100% rename from 17rc1-3.5.0alpha2/alpine/update-postgis.sh rename to 17-3.4/update-postgis.sh diff --git a/17rc1-3.5.0alpha2/Dockerfile b/17-3.5/Dockerfile similarity index 100% rename from 17rc1-3.5.0alpha2/Dockerfile rename to 17-3.5/Dockerfile diff --git a/17-3.5/alpine/Dockerfile b/17-3.5/alpine/Dockerfile new file mode 100644 index 00000000..75baccb6 --- /dev/null +++ b/17-3.5/alpine/Dockerfile @@ -0,0 +1,124 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. +# +ARG BASE_IMAGE=postgres:17-alpine3.20 +FROM ${BASE_IMAGE} + +LABEL maintainer="PostGIS Project - https://postgis.net" \ + org.opencontainers.image.description="PostGIS 3.5.0 spatial database extension with PostgreSQL 17 Alpine" \ + org.opencontainers.image.source="https://github.com/postgis/docker-postgis" + +ENV POSTGIS_VERSION 3.5.0 +ENV POSTGIS_SHA256 a47b8415ab88437390eba28e51b993cf0a2357057c277eea00378b8b76ab2316 + +RUN set -eux \ + && apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + openssl \ + tar \ + \ + && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ + && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/postgis \ + && tar \ + --extract \ + --file postgis.tar.gz \ + --directory /usr/src/postgis \ + --strip-components 1 \ + && rm postgis.tar.gz \ + \ + && apk add --no-cache --virtual .build-deps \ + \ + gdal-dev \ + geos-dev \ + proj-dev \ + proj-util \ + sfcgal-dev \ + \ + # The upstream variable, '$DOCKER_PG_LLVM_DEPS' contains + # the correct versions of 'llvm-dev' and 'clang' for the current version of PostgreSQL. + # This improvement has been discussed in https://github.com/docker-library/postgres/pull/1077 + $DOCKER_PG_LLVM_DEPS \ + \ + autoconf \ + automake \ + cunit-dev \ + file \ + g++ \ + gcc \ + gettext-dev \ + git \ + json-c-dev \ + libtool \ + libxml2-dev \ + make \ + pcre2-dev \ + perl \ + protobuf-c-dev \ + \ +# build PostGIS - with Link Time Optimization (LTO) enabled + && cd /usr/src/postgis \ + && gettextize \ + && ./autogen.sh \ + && ./configure \ + --enable-lto \ + && make -j$(nproc) \ + && make install \ + \ +# This section is for refreshing the proj data for the regression tests. +# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316 +# This increases the Docker image size by about 1 MB. + && projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \ + && projsync --system-directory --file us_noaa_eshpgn \ + && projsync --system-directory --file us_noaa_prvi \ + && projsync --system-directory --file us_noaa_wmhpgn \ +# This section performs a regression check. + && mkdir /tempdb \ + && chown -R postgres:postgres /tempdb \ + && su postgres -c 'pg_ctl -D /tempdb init' \ + && su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \ + && cd regress \ + && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ + \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_sfcgal;"' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; --needed for postgis_tiger_geocoder "' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer;"' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \ + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \ + && su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \ + && su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \ + && su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \ + \ + && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ + && rm -rf /tempdb \ + && rm -rf /tmp/logfile \ + && rm -rf /tmp/pgis_reg \ +# add .postgis-rundeps + && apk add --no-cache --virtual .postgis-rundeps \ + \ + gdal \ + geos \ + proj \ + sfcgal \ + \ + json-c \ + libstdc++ \ + pcre2 \ + protobuf-c \ + \ + # ca-certificates: for accessing remote raster files + # fix https://github.com/postgis/docker-postgis/issues/307 + ca-certificates \ +# clean + && cd / \ + && rm -rf /usr/src/postgis \ + && apk del .fetch-deps .build-deps \ +# At the end of the build, we print the collected information +# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes. + && cat /_pgis_full_version.txt + +COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh +COPY ./update-postgis.sh /usr/local/bin diff --git a/17rc1-master/initdb-postgis.sh b/17-3.5/alpine/initdb-postgis.sh similarity index 100% rename from 17rc1-master/initdb-postgis.sh rename to 17-3.5/alpine/initdb-postgis.sh diff --git a/17rc1-master/update-postgis.sh b/17-3.5/alpine/update-postgis.sh similarity index 100% rename from 17rc1-master/update-postgis.sh rename to 17-3.5/alpine/update-postgis.sh diff --git a/15-master/Dockerfile b/17-master/Dockerfile similarity index 95% rename from 15-master/Dockerfile rename to 17-master/Dockerfile index 11a688c0..77d0f911 100644 --- a/15-master/Dockerfile +++ b/17-master/Dockerfile @@ -7,10 +7,10 @@ ARG DOCKER_CMAKE_BUILD_TYPE=Release ARG CGAL_GIT_BRANCH=5.6.x-branch -FROM postgres:15-bullseye as builder +FROM postgres:17-bullseye as builder LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 15 bullseye" \ + org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 17 bullseye" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" WORKDIR / @@ -89,7 +89,7 @@ ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} ARG CGAL_GIT_BRANCH ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH} ENV CGAL5X_GIT_HASH f1af52edeb741a05f86d959984ed943f25f5fcd4 -ENV SFCGAL_GIT_HASH 3a493846b779ded5ac87b8a7b37e8c119d4208c2 +ENV SFCGAL_GIT_HASH 88ec10481fc51efb4d232fd2f45bb556120a6f4c RUN set -ex \ && mkdir -p /usr/src \ && cd /usr/src \ @@ -122,7 +122,7 @@ RUN set -ex \ && rm -fr /usr/src/cgal # proj -ENV PROJ_GIT_HASH 0a407325fbb5bf42407a7dc5d4f948be9707e302 +ENV PROJ_GIT_HASH d19ab643b9825bf4de5ff336e228b9abc06e2991 RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/PROJ.git \ @@ -152,7 +152,7 @@ RUN set -ex \ && rm -fr /usr/src/PROJ # geos -ENV GEOS_GIT_HASH 701c868fa9ad8e82a3aa43f0bd19ec2003722f45 +ENV GEOS_GIT_HASH e142764b77f4b8d0c36ec88406300c5f876743fb RUN set -ex \ && cd /usr/src \ && git clone https://github.com/libgeos/geos.git \ @@ -168,7 +168,7 @@ RUN set -ex \ && rm -fr /usr/src/geos # gdal -ENV GDAL_GIT_HASH 6a5ab0e588d17b8cc9ee16c212407c0bd3f05a9b +ENV GDAL_GIT_HASH 91bfec36a4dc03cfba554e6197a83099d9ec122a RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/gdal.git \ @@ -252,7 +252,7 @@ RUN set -ex \ # ------------------------------------------- # STAGE final # ------------------------------------------- -FROM postgres:15-bullseye +FROM postgres:17-bullseye ARG DOCKER_CMAKE_BUILD_TYPE ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} @@ -302,10 +302,10 @@ 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 3a493846b779ded5ac87b8a7b37e8c119d4208c2 -ENV PROJ_GIT_HASH 0a407325fbb5bf42407a7dc5d4f948be9707e302 -ENV GEOS_GIT_HASH 701c868fa9ad8e82a3aa43f0bd19ec2003722f45 -ENV GDAL_GIT_HASH 6a5ab0e588d17b8cc9ee16c212407c0bd3f05a9b +ENV SFCGAL_GIT_HASH 88ec10481fc51efb4d232fd2f45bb556120a6f4c +ENV PROJ_GIT_HASH d19ab643b9825bf4de5ff336e228b9abc06e2991 +ENV GEOS_GIT_HASH e142764b77f4b8d0c36ec88406300c5f876743fb +ENV GDAL_GIT_HASH 91bfec36a4dc03cfba554e6197a83099d9ec122a # Minimal command line test ( fail fast ) RUN set -ex \ @@ -324,7 +324,7 @@ RUN set -ex \ || echo "ogr2ogr missing PostgreSQL driver" && exit 1 # install postgis -ENV POSTGIS_GIT_HASH 8349e1670aa4f273dd68813813a1a37b59c12a8c +ENV POSTGIS_GIT_HASH b28f00c3efd772460714cb9db30b0dc9a0ff27fd RUN set -ex \ && apt-get update \ diff --git a/17-master/initdb-postgis.sh b/17-master/initdb-postgis.sh new file mode 100644 index 00000000..e38ad7d6 --- /dev/null +++ b/17-master/initdb-postgis.sh @@ -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 diff --git a/17-master/update-postgis.sh b/17-master/update-postgis.sh new file mode 100755 index 00000000..f98abd26 --- /dev/null +++ b/17-master/update-postgis.sh @@ -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 diff --git a/17rc1-master/Dockerfile b/17rc1-master/Dockerfile deleted file mode 100644 index 48c9c3df..00000000 --- a/17rc1-master/Dockerfile +++ /dev/null @@ -1,462 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. -# - -# "Experimental"; solely for testing purposes. Anticipate frequent changes! -# 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 -FROM postgres:17rc1-bullseye as builder - -LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 17rc1 bullseye" \ - org.opencontainers.image.source="https://github.com/postgis/docker-postgis" - -WORKDIR / - -# apt-get install -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic1.74.0 \ - libboost-chrono1.74.0 \ - libboost-date-time1.74.0 \ - libboost-filesystem1.74.0 \ - libboost-program-options1.74.0 \ - libboost-serialization1.74.0 \ - libboost-system1.74.0 \ - libboost-test1.74.0 \ - libboost-thread1.74.0 \ - libboost-timer1.74.0 \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c5 \ - libmpfr6 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - # build dependency - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libpq-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - protobuf-c-compiler \ - xsltproc \ - # gdal+ - libblosc-dev \ - libcfitsio-dev \ - libfreexl-dev \ - libfyba-dev \ - libhdf5-dev \ - libkml-dev \ - liblz4-dev \ - liblzma-dev \ - libopenjp2-7-dev \ - libqhull-dev \ - libwebp-dev \ - libzstd-dev - -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 3a493846b779ded5ac87b8a7b37e8c119d4208c2 -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 log -1 > /_pgis_cgal_last_commit.txt \ - && cd /usr/src \ - && git clone https://gitlab.com/SFCGAL/SFCGAL.git \ - && cd SFCGAL \ - && git checkout ${SFCGAL_GIT_HASH} \ - && git log -1 > /_pgis_sfcgal_last_commit.txt \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake .. \ - -DCGAL_DIR=/usr/src/cgal \ - -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} \ - -DSFCGAL_BUILD_BENCH=OFF \ - -DSFCGAL_BUILD_EXAMPLES=OFF \ - -DSFCGAL_BUILD_TESTS=OFF \ - -DSFCGAL_WITH_OSG=OFF \ - && make -j$(nproc) \ - && make install \ - # - ## testing with -DSFCGAL_BUILD_TESTS=ON - # && CTEST_OUTPUT_ON_FAILURE=TRUE ctest \ - # - # clean - && rm -fr /usr/src/SFCGAL \ - && rm -fr /usr/src/cgal - -# proj -ENV PROJ_GIT_HASH 0a407325fbb5bf42407a7dc5d4f948be9707e302 -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/PROJ.git \ - && cd PROJ \ - && git checkout ${PROJ_GIT_HASH} \ - && git log -1 > /_pgis_proj_last_commit.txt \ - # check the autotools exist? https://github.com/OSGeo/PROJ/pull/3027 - && if [ -f "autogen.sh" ] ; then \ - set -eux \ - && echo "autotools version: 'autogen.sh' exists! Older version!" \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - ; \ - else \ - set -eux \ - && echo "cmake version: 'autogen.sh' does not exists! Newer version!" \ - && mkdir build \ - && cd build \ - && cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \ - && make -j$(nproc) \ - && make install \ - ; \ - fi \ - \ - && rm -fr /usr/src/PROJ - -# geos -ENV GEOS_GIT_HASH 701c868fa9ad8e82a3aa43f0bd19ec2003722f45 -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/libgeos/geos.git \ - && cd geos \ - && git checkout ${GEOS_GIT_HASH} \ - && git log -1 > /_pgis_geos_last_commit.txt \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/geos - -# gdal -ENV GDAL_GIT_HASH 6a5ab0e588d17b8cc9ee16c212407c0bd3f05a9b -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/gdal.git \ - && cd gdal \ - && git checkout ${GDAL_GIT_HASH} \ - && git log -1 > /_pgis_gdal_last_commit.txt \ - \ - # gdal project directory structure - has been changed ! - && if [ -d "gdal" ] ; then \ - echo "Directory 'gdal' dir exists -> older version!" ; \ - cd gdal ; \ - else \ - echo "Directory 'gdal' does not exists! Newer version! " ; \ - fi \ - \ - && if [ -f "./autogen.sh" ]; then \ - # Building with autoconf ( old/deprecated ) - set -eux \ - && ./autogen.sh \ - && ./configure --disable-static \ - ; \ - else \ - # Building with cmake - set -eux \ - && mkdir build \ - && cd build \ - # config based on: https://salsa.debian.org/debian-gis-team/gdal/-/blob/master/debian/rules - && cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \ - -DBUILD_DOCS=OFF \ - \ - -DGDAL_HIDE_INTERNAL_SYMBOLS=ON \ - -DRENAME_INTERNAL_TIFF_SYMBOLS=ON \ - -DGDAL_USE_BLOSC=ON \ - -DGDAL_USE_CFITSIO=ON \ - -DGDAL_USE_CURL=ON \ - -DGDAL_USE_DEFLATE=ON \ - -DGDAL_USE_EXPAT=ON \ - -DGDAL_USE_FREEXL=ON \ - -DGDAL_USE_FYBA=ON \ - -DGDAL_USE_GEOS=ON \ - -DGDAL_USE_HDF5=ON \ - -DGDAL_USE_JSONC=ON \ - -DGDAL_USE_LERC_INTERNAL=ON \ - -DGDAL_USE_LIBKML=ON \ - -DGDAL_USE_LIBLZMA=ON \ - -DGDAL_USE_LZ4=ON \ - -DGDAL_USE_OPENJPEG=ON \ - -DGDAL_USE_POSTGRESQL=ON \ - -DGDAL_USE_QHULL=ON \ - -DGDAL_USE_SQLITE3=ON \ - -DGDAL_USE_TIFF=ON \ - -DGDAL_USE_WEBP=ON \ - -DGDAL_USE_ZSTD=ON \ - \ - # OFF and Not working https://github.com/OSGeo/gdal/issues/7100 - # -DRENAME_INTERNAL_GEOTIFF_SYMBOLS=ON \ - -DGDAL_USE_ECW=OFF \ - -DGDAL_USE_GEOTIFF=OFF \ - -DGDAL_USE_HEIF=OFF \ - -DGDAL_USE_SPATIALITE=OFF \ - ; \ - fi \ - \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/gdal - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && ldd $(which gdalinfo) \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version \ - && pcre-config --version - -# ------------------------------------------- -# STAGE final -# ------------------------------------------- -FROM postgres:17rc1-bullseye - -ARG DOCKER_CMAKE_BUILD_TYPE -ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic1.74.0 \ - libboost-chrono1.74.0 \ - libboost-date-time1.74.0 \ - libboost-filesystem1.74.0 \ - libboost-program-options1.74.0 \ - libboost-serialization1.74.0 \ - libboost-system1.74.0 \ - libboost-test1.74.0 \ - libboost-thread1.74.0 \ - libboost-timer1.74.0 \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c5 \ - libmpfr6 \ - libpcre3 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - # gdal+ - libblosc1 \ - libcfitsio9 \ - libfreexl1 \ - libfyba0 \ - libhdf5-103-1 \ - libkmlbase1 \ - libkmldom1 \ - libkmlengine1 \ - libopenjp2-7 \ - libqhull-r8.0 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /_pgis*.* / -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 3a493846b779ded5ac87b8a7b37e8c119d4208c2 -ENV PROJ_GIT_HASH 0a407325fbb5bf42407a7dc5d4f948be9707e302 -ENV GEOS_GIT_HASH 701c868fa9ad8e82a3aa43f0bd19ec2003722f45 -ENV GDAL_GIT_HASH 6a5ab0e588d17b8cc9ee16c212407c0bd3f05a9b - -# Minimal command line test ( fail fast ) -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && ldd $(which gdalinfo) \ - && gdalinfo --version \ - && gdal-config --formats \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version \ - \ - # Testing ogr2ogr PostgreSQL driver. - && ogr2ogr --formats | grep -q "PostgreSQL/PostGIS" && exit 0 \ - || echo "ogr2ogr missing PostgreSQL driver" && exit 1 - -# install postgis -ENV POSTGIS_GIT_HASH 8349e1670aa4f273dd68813813a1a37b59c12a8c - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - docbook-xml \ - docbook5-xml \ - g++ \ - git \ - libboost-all-dev \ - libcunit1-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - libxml2-utils \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && cd \ - # postgis - && cd /usr/src/ \ - && git clone https://github.com/postgis/postgis.git \ - && cd postgis \ - && git checkout ${POSTGIS_GIT_HASH} \ - && git log -1 > /_pgis_last_commit.txt \ - && ./autogen.sh \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie - && ./configure \ - --enable-lto \ - && make -j$(nproc) \ - && make install \ -# refresh proj data - workarounds: https://trac.osgeo.org/postgis/ticket/5316 - && projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \ - && projsync --system-directory --file us_noaa_eshpgn \ - && projsync --system-directory --file us_noaa_prvi \ - && projsync --system-directory --file us_noaa_wmhpgn \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \ - && ldconfig \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_sfcgal;"' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; --needed for postgis_tiger_geocoder "' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer;"' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \ - && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \ - && su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \ - && su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \ - && su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \ - \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/logfile \ - && rm -rf /tmp/pgis_reg \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apt-get purge -y --autoremove \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - cmake \ - docbook-xml \ - docbook5-xml \ - g++ \ - git \ - libboost-all-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - libxml2-utils \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && apt-get clean \ - && 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 - -# last final test -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && ldd $(which gdalinfo) \ - && gdalinfo --version \ - && gdal-config --formats \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version \ - \ - # Is the "ca-certificates" package installed? (for accessing remote raster files) - # https://github.com/postgis/docker-postgis/issues/307 - && dpkg-query -W -f='${Status}' ca-certificates 2>/dev/null | grep -c "ok installed" \ - \ - # list last commits. - && find /_pgis_*_last_commit.txt -type f -print -exec cat {} \; \ - # list postgresql, postgis version - && cat _pgis_full_version.txt diff --git a/README.md b/README.md index 5f8f40d6..4e896869 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![Join the chat at https://gitter.im/postgis/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/postgis/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `postgis/postgis` image provides tags for running Postgres with [PostGIS](http://postgis.net/) extensions installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides debian and alpine variants for PostGIS 3.4.x, which is compatible with PostgreSQL versions 12, 13, 14, 15, and 16. Additionally, an image version is provided which is built from the latest two versions of Postgres (15, 16) with versions of PostGIS and its dependencies built from their respective master branches. +The `postgis/postgis` image provides tags for running Postgres with [PostGIS](http://postgis.net/) extensions installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides debian and alpine variants for PostGIS 3.4.x, which is compatible with PostgreSQL versions 12, 13, 14, 15, 16 and 17. Additionally, an image version is provided which is built from the latest two versions of Postgres (16, 17) with versions of PostGIS and its dependencies built from their respective master branches. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: @@ -18,11 +18,11 @@ This image ensures that the default database created by the parent `postgres` im Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`. -# Versions (2024-09-14) +# Versions (2024-09-27) Supported architecture: `amd64` (also known as X86-64)" -Recommended version for new users: `postgis/postgis:16-3.4` +Recommended versions for new users are: `postgis/postgis:17-3.4`, `postgis/postgis:16-3.4` ### Debian based (recommended) @@ -32,27 +32,31 @@ Recommended version for new users: `postgis/postgis:16-3.4` * In the Debian Bullseye repository, the versions are: geos=3.9, gdal=3.2, proj=7.2, and sfcgal=1.3.9. * This version is easy to extend and has matured over time. -| DockerHub image | Dockerfile | OS | Postgres | PostGIS | + DockerHub image | Dockerfile | OS | Postgres | PostGIS | | --------------- | ---------- | -- | -------- | ------- | -| [postgis/postgis:12-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=12-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/12-3.4/Dockerfile) | debian:bullseye | 12 | 3.4.2 | -| [postgis/postgis:13-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=13-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/13-3.4/Dockerfile) | debian:bullseye | 13 | 3.4.2 | -| [postgis/postgis:14-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=14-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/14-3.4/Dockerfile) | debian:bullseye | 14 | 3.4.2 | -| [postgis/postgis:15-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=15-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/15-3.4/Dockerfile) | debian:bullseye | 15 | 3.4.2 | -| [postgis/postgis:16-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-3.4/Dockerfile) | debian:bullseye | 16 | 3.4.2 | +| [postgis/postgis:12-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=12-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/12-3.4/Dockerfile) | debian:bullseye | 12 | 3.4.3 | +| [postgis/postgis:13-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=13-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/13-3.4/Dockerfile) | debian:bullseye | 13 | 3.4.3 | +| [postgis/postgis:14-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=14-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/14-3.4/Dockerfile) | debian:bullseye | 14 | 3.4.3 | +| [postgis/postgis:15-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=15-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/15-3.4/Dockerfile) | debian:bullseye | 15 | 3.4.3 | +| [postgis/postgis:16-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-3.4/Dockerfile) | debian:bullseye | 16 | 3.4.3 | +| [postgis/postgis:17-3.4](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17-3.4) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17-3.4/Dockerfile) | debian:bullseye | 17 | 3.4.3 | ### Alpine based * The base operating system is [Alpine Linux](https://alpinelinux.org/). It is designed to be small, simple, and secure, and it's based on [musl libc](https://musl.libc.org/). -* In the Alpine 3.20 version, the package versions are: geos=3.12.2, gdal=3.9.1, proj=9.4, and sfcgal=1.5.1 +* In the Alpine 3.20 version, the package versions are: geos=3.12.2, gdal=3.9.2, proj=9.4, and sfcgal=1.5.1 * PostGIS is compiled from source, making it a bit more challenging to extend. | DockerHub image | Dockerfile | OS | Postgres | PostGIS | | --------------- | ---------- | -- | -------- | ------- | -| [postgis/postgis:12-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=12-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/12-3.4/alpine/Dockerfile) | alpine:3.20 | 12 | 3.4.2 | -| [postgis/postgis:13-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=13-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/13-3.4/alpine/Dockerfile) | alpine:3.20 | 13 | 3.4.2 | -| [postgis/postgis:14-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=14-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/14-3.4/alpine/Dockerfile) | alpine:3.20 | 14 | 3.4.2 | -| [postgis/postgis:15-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=15-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/15-3.4/alpine/Dockerfile) | alpine:3.20 | 15 | 3.4.2 | -| [postgis/postgis:16-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-3.4/alpine/Dockerfile) | alpine:3.20 | 16 | 3.4.2 | +| [postgis/postgis:12-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=12-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/12-3.4/alpine/Dockerfile) | alpine:3.20 | 12 | 3.4.3 | +| [postgis/postgis:13-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=13-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/13-3.4/alpine/Dockerfile) | alpine:3.20 | 13 | 3.4.3 | +| [postgis/postgis:14-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=14-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/14-3.4/alpine/Dockerfile) | alpine:3.20 | 14 | 3.4.3 | +| [postgis/postgis:15-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=15-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/15-3.4/alpine/Dockerfile) | alpine:3.20 | 15 | 3.4.3 | +| [postgis/postgis:16-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-3.4/alpine/Dockerfile) | alpine:3.20 | 16 | 3.4.3 | +| [postgis/postgis:16-3.5-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-3.5-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-3.5/alpine/Dockerfile) | alpine:3.20 | 16 | 3.5.0 | +| [postgis/postgis:17-3.4-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17-3.4-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17-3.4/alpine/Dockerfile) | alpine:3.20 | 17 | 3.4.3 | +| [postgis/postgis:17-3.5-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17-3.5-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17-3.5/alpine/Dockerfile) | alpine:3.20 | 17 | 3.5.0 | ### Test images @@ -62,12 +66,9 @@ Recommended version for new users: `postgis/postgis:16-3.4` | DockerHub image | Dockerfile | OS | Postgres | PostGIS | | --------------- | ---------- | -- | -------- | ------- | -| [postgis/postgis:15-master](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=15-master) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/15-master/Dockerfile) | debian:bullseye | 15 | development: postgis, geos, proj, gdal | -| [postgis/postgis:16-3.5.0alpha2-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-3.5.0alpha2-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-3.5.0alpha2/alpine/Dockerfile) | alpine:3.20 | 16 | 3.5.0alpha2 | | [postgis/postgis:16-master](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=16-master) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/16-master/Dockerfile) | debian:bullseye | 16 | development: postgis, geos, proj, gdal | -| [postgis/postgis:17rc1-3.5.0alpha2-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17rc1-3.5.0alpha2-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17rc1-3.5.0alpha2/alpine/Dockerfile) | alpine:3.20 | 17rc1 | 3.5.0alpha2 | -| [postgis/postgis:17rc1-master](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17rc1-master) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17rc1-master/Dockerfile) | debian:bullseye | 17rc1 | development: postgis, geos, proj, gdal | - +| [postgis/postgis:17-master](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17-master) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17-master/Dockerfile) | debian:bullseye | 17 | development: postgis, geos, proj, gdal | + ## Usage In order to run a basic container capable of serving a PostGIS-enabled database, start a container as follows: diff --git a/update.sh b/update.sh index f9f88934..e88d5c8a 100755 --- a/update.sh +++ b/update.sh @@ -57,6 +57,80 @@ gdalGitHash="$(git ls-remote https://github.com/OSGeo/gdal.git refs/heads/master geosGitHash="$(git ls-remote https://github.com/libgeos/geos.git heads/main | awk '{ print $1}')" postgisGitHash="$(git ls-remote https://github.com/postgis/postgis.git heads/master | awk '{ print $1}')" +#------------------------------------------- +# Correct version sorting +function version_reverse_sort() { + # This function sorts version numbers in reverse order, + # ensuring that versions without pre-release tags (e.g., "3.4.0") + # are ranked higher than those with pre-release tags (e.g., "3.4.0rc4"). + # It adds a ".9991" suffix to versions without pre-release tags, + # sorts them with `sort -Vr`, and then removes the ".9991" suffix. + sed -r "s/([0-9]+\.[0-9]+\.[0-9]+$)/\1\.9991/" | sort -Vr | sed s/\.9991$// +} + +api_preference="github" +function fetch_postgis_versions() { + # get all postgis versions from github + local REPO="postgis/postgis" + local PER_PAGE=100 # You can ask for up to 100 results per page + local page=1 + postgis_all_v3_versions="" + + while true; do + local response + if [ "$api_preference" == "github" ]; then + response=$(curl --silent "https://api.github.com/repos/$REPO/tags?per_page=$PER_PAGE&page=$page") || { + echo "Failed to fetch postgis_versions from api.github.com/repos/$REPO/tags" + return 1 + } + elif [ "$api_preference" == "osgeo" ]; then + response=$(curl --silent "https://git.osgeo.org/gitea/api/v1/repos/${REPO}/tags?page=$page&limit=$PER_PAGE") || { + echo "Failed to fetch postgis_versions from git.osgeo.org/gitea/api/v1/repos/${REPO}/tags" + return 1 + } + fi + + # Check for rate limit exceeded error - related to api.github.com + if echo "$response" | grep -q "API rate limit exceeded"; then + echo "Error: API rate limit exceeded!" + echo "$response" + exit 1 + fi + + # Extract tag names from the JSON response + local tags + tags=$(echo "$response" | grep -Po '"name":\s*"\K[^"]+' || true) + local count + count=$(echo "$tags" | sed '/^$/d' | wc -l) + + if ((count == 0)); then + break + fi + + if ((page > 12)); then + echo "Too many pages: ${page} - exiting; unexpected and something is wrong!" + exit 1 + fi + + postgis_all_v3_versions+=" $tags" + + ((page++)) + done +} + +fetch_postgis_versions || { + echo "Error fetching postgis versions! Maybe network or server error!" + exit 1 +} + +# Keep 3.* versions only +postgis_all_v3_versions=$(echo "$postgis_all_v3_versions" | sed '/^$/d' | grep '^3\.' | version_reverse_sort) +postgis_all_v3_versions_array_string=$(echo "$postgis_all_v3_versions" | tr '\n' ' ') +echo "postgis_all_v3_versions_array_string = ${postgis_all_v3_versions_array_string}" +echo " " + +#------------------------------------------- + declare -A suitePackageList=() suiteArches=() for version in "${versions[@]}"; do IFS=- read postgresVersion postgisVersion <<< "$version" @@ -140,9 +214,17 @@ for version in "${versions[@]}"; do echo " # This is an autogenerated message of ./update.sh " >> "$version/Dockerfile" rm -f "$version/*.sh" rm -f "$version/*.md" - # use the default for the alpine version - postgisFullVersion=$postgisVersion - postgisDocSrc=$postgisVersion + # detect the exact Postgis version - for the alpine version + # check the latest released 3.x version (so not alpha/beta/rc) + _postgisMinor=$(echo "$postgisMajMin" | cut -d. -f2) + postgisFullVersion=$(echo "$postgis_all_v3_versions" | grep "^3\.${_postgisMinor}\." | grep -v '[a-zA-Z]' | version_reverse_sort | head -n 1 || true) + # Check if the result is empty + if [[ -z "${postgisFullVersion}" ]]; then + # If empty, run the command again without excluding pre-releases (alpha/beta/rc) + postgisFullVersion=$(echo "$postgis_all_v3_versions" | grep "^3\.${_postgisMinor}\." | version_reverse_sort | head -n 1 || true) + fi + postgisDocSrc=$postgisFullVersion + echo "!!!!! postgisFullVersion = ${postgisFullVersion}"; else ( set -x