From f29f8fd7eb736d3559408dfddbb9bdb36fdcaf22 Mon Sep 17 00:00:00 2001 From: thomasboussekey Date: Sun, 14 Jul 2024 12:31:50 +0200 Subject: [PATCH 1/3] bump base image to 17-beta2 --- 17-beta/Dockerfile | 462 ++++++++++++++++++++++++++++++++++++++ 17-beta/initdb-postgis.sh | 25 +++ 17-beta/update-postgis.sh | 28 +++ 3 files changed, 515 insertions(+) create mode 100644 17-beta/Dockerfile create mode 100644 17-beta/initdb-postgis.sh create mode 100755 17-beta/update-postgis.sh diff --git a/17-beta/Dockerfile b/17-beta/Dockerfile new file mode 100644 index 00000000..851c1a91 --- /dev/null +++ b/17-beta/Dockerfile @@ -0,0 +1,462 @@ +# +# 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:17beta2-bullseye as builder + +LABEL maintainer="PostGIS Project - https://postgis.net" \ + org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 16 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 188e51bad36ffc30e49dbabda29620b71a84664c +ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 +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 356496f7b60ee0235189dd51d99aac700fbd2bdc +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 a8d2ed0aba46f88f9b8987526e68eea6565d16ae +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 d7aed6e0b03f949ba40684f868c63a08d89177b1 +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:17beta2-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 188e51bad36ffc30e49dbabda29620b71a84664c +ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 +ENV PROJ_GIT_HASH 356496f7b60ee0235189dd51d99aac700fbd2bdc +ENV GEOS_GIT_HASH a8d2ed0aba46f88f9b8987526e68eea6565d16ae +ENV GDAL_GIT_HASH d7aed6e0b03f949ba40684f868c63a08d89177b1 + +# 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 8ed84517a9b86c86724504d1b6a0f0c1ccd86cf6 + +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/17-beta/initdb-postgis.sh b/17-beta/initdb-postgis.sh new file mode 100644 index 00000000..e38ad7d6 --- /dev/null +++ b/17-beta/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-beta/update-postgis.sh b/17-beta/update-postgis.sh new file mode 100755 index 00000000..f98abd26 --- /dev/null +++ b/17-beta/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 From 8a0cbf9bcc303e990d0bca4e35c813fd0b4f3071 Mon Sep 17 00:00:00 2001 From: ImreSamu Date: Fri, 19 Jul 2024 16:20:10 +0200 Subject: [PATCH 2/3] fix/add pg17beta2 and postgis3.5.0alpha2 - rename/fix 17-beta to 17beta2-master - add 17beta2-3.5.0alpha2-alpine - add 16-3.5.0alpha2-alpine - update README.md, update.sh, main.yml running ./update.sh --- .github/workflows/main.yml | 9 ++ 15-master/Dockerfile | 22 ++-- 16-3.5.0alpha2/Dockerfile | 3 + 16-3.5.0alpha2/alpine/Dockerfile | 124 ++++++++++++++++++ .../alpine}/initdb-postgis.sh | 0 .../alpine}/update-postgis.sh | 0 16-master/Dockerfile | 22 ++-- 17beta2-3.5.0alpha2/Dockerfile | 3 + 17beta2-3.5.0alpha2/alpine/Dockerfile | 124 ++++++++++++++++++ 17beta2-3.5.0alpha2/alpine/initdb-postgis.sh | 25 ++++ 17beta2-3.5.0alpha2/alpine/update-postgis.sh | 28 ++++ {17-beta => 17beta2-master}/Dockerfile | 24 ++-- 17beta2-master/initdb-postgis.sh | 25 ++++ 17beta2-master/update-postgis.sh | 28 ++++ README.md | 5 +- update.sh | 2 + 16 files changed, 409 insertions(+), 35 deletions(-) create mode 100644 16-3.5.0alpha2/Dockerfile create mode 100644 16-3.5.0alpha2/alpine/Dockerfile rename {17-beta => 16-3.5.0alpha2/alpine}/initdb-postgis.sh (100%) rename {17-beta => 16-3.5.0alpha2/alpine}/update-postgis.sh (100%) create mode 100644 17beta2-3.5.0alpha2/Dockerfile create mode 100644 17beta2-3.5.0alpha2/alpine/Dockerfile create mode 100644 17beta2-3.5.0alpha2/alpine/initdb-postgis.sh create mode 100755 17beta2-3.5.0alpha2/alpine/update-postgis.sh rename {17-beta => 17beta2-master}/Dockerfile (94%) create mode 100644 17beta2-master/initdb-postgis.sh create mode 100755 17beta2-master/update-postgis.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9687a2a4..b4e60b99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,15 @@ jobs: - postgres: 16 postgis: master variant: default + - postgres: 17beta2 + postgis: master + variant: default + - postgres: 16 + postgis: 3.5.0alpha2 + variant: alpine + - postgres: 17beta2 + postgis: 3.5.0alpha2 + variant: alpine name: Build docker image for ${{ matrix.postgres }}-${{ matrix.postgis }} variant ${{ matrix.variant }} runs-on: ubuntu-20.04 diff --git a/15-master/Dockerfile b/15-master/Dockerfile index ea0ad7d2..6b803a84 100644 --- a/15-master/Dockerfile +++ b/15-master/Dockerfile @@ -88,8 +88,8 @@ ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} # 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 188e51bad36ffc30e49dbabda29620b71a84664c -ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 +ENV CGAL5X_GIT_HASH dfa981a844c121f4407e1f83092ccc533197b932 +ENV SFCGAL_GIT_HASH a976da3b52692f4d3c30c898eac80673f8507b6d 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 356496f7b60ee0235189dd51d99aac700fbd2bdc +ENV PROJ_GIT_HASH cce46228bde5b7dfa6d3b9048865f43dfbbeda30 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 a8d2ed0aba46f88f9b8987526e68eea6565d16ae +ENV GEOS_GIT_HASH 42546119c35e65aad72dea1477eb4a057ead631e 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 d7aed6e0b03f949ba40684f868c63a08d89177b1 +ENV GDAL_GIT_HASH 0c57764ec2040c4e53c0313844ea5afccdc00279 RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/gdal.git \ @@ -301,11 +301,11 @@ COPY --from=builder /usr/local /usr/local ARG CGAL_GIT_BRANCH ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH} -ENV CGAL5X_GIT_HASH 188e51bad36ffc30e49dbabda29620b71a84664c -ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 -ENV PROJ_GIT_HASH 356496f7b60ee0235189dd51d99aac700fbd2bdc -ENV GEOS_GIT_HASH a8d2ed0aba46f88f9b8987526e68eea6565d16ae -ENV GDAL_GIT_HASH d7aed6e0b03f949ba40684f868c63a08d89177b1 +ENV CGAL5X_GIT_HASH dfa981a844c121f4407e1f83092ccc533197b932 +ENV SFCGAL_GIT_HASH a976da3b52692f4d3c30c898eac80673f8507b6d +ENV PROJ_GIT_HASH cce46228bde5b7dfa6d3b9048865f43dfbbeda30 +ENV GEOS_GIT_HASH 42546119c35e65aad72dea1477eb4a057ead631e +ENV GDAL_GIT_HASH 0c57764ec2040c4e53c0313844ea5afccdc00279 # 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 8ed84517a9b86c86724504d1b6a0f0c1ccd86cf6 +ENV POSTGIS_GIT_HASH 95c525d310b783db4a52d85506ef3cc713238683 RUN set -ex \ && apt-get update \ diff --git a/16-3.5.0alpha2/Dockerfile b/16-3.5.0alpha2/Dockerfile new file mode 100644 index 00000000..51881a02 --- /dev/null +++ b/16-3.5.0alpha2/Dockerfile @@ -0,0 +1,3 @@ + # placeholder Dockerfile + # Debian version of postgis is not detected! + # This is an autogenerated message of ./update.sh diff --git a/16-3.5.0alpha2/alpine/Dockerfile b/16-3.5.0alpha2/alpine/Dockerfile new file mode 100644 index 00000000..b45e796c --- /dev/null +++ b/16-3.5.0alpha2/alpine/Dockerfile @@ -0,0 +1,124 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. +# +ARG BASE_IMAGE=postgres:16-alpine3.18 +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.source="https://github.com/postgis/docker-postgis" + +ENV POSTGIS_VERSION 3.5.0alpha2 +ENV POSTGIS_SHA256 27c69b0f3d0a1329897060fb5e8345162d960f30b95f8903e98356fb3236427f + +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/17-beta/initdb-postgis.sh b/16-3.5.0alpha2/alpine/initdb-postgis.sh similarity index 100% rename from 17-beta/initdb-postgis.sh rename to 16-3.5.0alpha2/alpine/initdb-postgis.sh diff --git a/17-beta/update-postgis.sh b/16-3.5.0alpha2/alpine/update-postgis.sh similarity index 100% rename from 17-beta/update-postgis.sh rename to 16-3.5.0alpha2/alpine/update-postgis.sh diff --git a/16-master/Dockerfile b/16-master/Dockerfile index 091545be..3b9d7835 100644 --- a/16-master/Dockerfile +++ b/16-master/Dockerfile @@ -88,8 +88,8 @@ ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} # 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 188e51bad36ffc30e49dbabda29620b71a84664c -ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 +ENV CGAL5X_GIT_HASH dfa981a844c121f4407e1f83092ccc533197b932 +ENV SFCGAL_GIT_HASH a976da3b52692f4d3c30c898eac80673f8507b6d 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 356496f7b60ee0235189dd51d99aac700fbd2bdc +ENV PROJ_GIT_HASH cce46228bde5b7dfa6d3b9048865f43dfbbeda30 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 a8d2ed0aba46f88f9b8987526e68eea6565d16ae +ENV GEOS_GIT_HASH 42546119c35e65aad72dea1477eb4a057ead631e 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 d7aed6e0b03f949ba40684f868c63a08d89177b1 +ENV GDAL_GIT_HASH 0c57764ec2040c4e53c0313844ea5afccdc00279 RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/gdal.git \ @@ -301,11 +301,11 @@ COPY --from=builder /usr/local /usr/local ARG CGAL_GIT_BRANCH ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH} -ENV CGAL5X_GIT_HASH 188e51bad36ffc30e49dbabda29620b71a84664c -ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 -ENV PROJ_GIT_HASH 356496f7b60ee0235189dd51d99aac700fbd2bdc -ENV GEOS_GIT_HASH a8d2ed0aba46f88f9b8987526e68eea6565d16ae -ENV GDAL_GIT_HASH d7aed6e0b03f949ba40684f868c63a08d89177b1 +ENV CGAL5X_GIT_HASH dfa981a844c121f4407e1f83092ccc533197b932 +ENV SFCGAL_GIT_HASH a976da3b52692f4d3c30c898eac80673f8507b6d +ENV PROJ_GIT_HASH cce46228bde5b7dfa6d3b9048865f43dfbbeda30 +ENV GEOS_GIT_HASH 42546119c35e65aad72dea1477eb4a057ead631e +ENV GDAL_GIT_HASH 0c57764ec2040c4e53c0313844ea5afccdc00279 # 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 8ed84517a9b86c86724504d1b6a0f0c1ccd86cf6 +ENV POSTGIS_GIT_HASH 95c525d310b783db4a52d85506ef3cc713238683 RUN set -ex \ && apt-get update \ diff --git a/17beta2-3.5.0alpha2/Dockerfile b/17beta2-3.5.0alpha2/Dockerfile new file mode 100644 index 00000000..51881a02 --- /dev/null +++ b/17beta2-3.5.0alpha2/Dockerfile @@ -0,0 +1,3 @@ + # placeholder Dockerfile + # Debian version of postgis is not detected! + # This is an autogenerated message of ./update.sh diff --git a/17beta2-3.5.0alpha2/alpine/Dockerfile b/17beta2-3.5.0alpha2/alpine/Dockerfile new file mode 100644 index 00000000..d05aa8cf --- /dev/null +++ b/17beta2-3.5.0alpha2/alpine/Dockerfile @@ -0,0 +1,124 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. +# +ARG BASE_IMAGE=postgres:17beta2-alpine3.18 +FROM ${BASE_IMAGE} + +LABEL maintainer="PostGIS Project - https://postgis.net" \ + org.opencontainers.image.description="PostGIS 3.5.0alpha2 spatial database extension with PostgreSQL 17beta2 Alpine" \ + org.opencontainers.image.source="https://github.com/postgis/docker-postgis" + +ENV POSTGIS_VERSION 3.5.0alpha2 +ENV POSTGIS_SHA256 27c69b0f3d0a1329897060fb5e8345162d960f30b95f8903e98356fb3236427f + +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/17beta2-3.5.0alpha2/alpine/initdb-postgis.sh b/17beta2-3.5.0alpha2/alpine/initdb-postgis.sh new file mode 100644 index 00000000..e38ad7d6 --- /dev/null +++ b/17beta2-3.5.0alpha2/alpine/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/17beta2-3.5.0alpha2/alpine/update-postgis.sh b/17beta2-3.5.0alpha2/alpine/update-postgis.sh new file mode 100755 index 00000000..f98abd26 --- /dev/null +++ b/17beta2-3.5.0alpha2/alpine/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/17-beta/Dockerfile b/17beta2-master/Dockerfile similarity index 94% rename from 17-beta/Dockerfile rename to 17beta2-master/Dockerfile index 851c1a91..de6800e0 100644 --- a/17-beta/Dockerfile +++ b/17beta2-master/Dockerfile @@ -10,7 +10,7 @@ ARG CGAL_GIT_BRANCH=5.6.x-branch FROM postgres:17beta2-bullseye as builder LABEL maintainer="PostGIS Project - https://postgis.net" \ - org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 16 bullseye" \ + org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 17beta2 bullseye" \ org.opencontainers.image.source="https://github.com/postgis/docker-postgis" WORKDIR / @@ -88,8 +88,8 @@ ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} # 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 188e51bad36ffc30e49dbabda29620b71a84664c -ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 +ENV CGAL5X_GIT_HASH dfa981a844c121f4407e1f83092ccc533197b932 +ENV SFCGAL_GIT_HASH a976da3b52692f4d3c30c898eac80673f8507b6d 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 356496f7b60ee0235189dd51d99aac700fbd2bdc +ENV PROJ_GIT_HASH cce46228bde5b7dfa6d3b9048865f43dfbbeda30 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 a8d2ed0aba46f88f9b8987526e68eea6565d16ae +ENV GEOS_GIT_HASH 42546119c35e65aad72dea1477eb4a057ead631e 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 d7aed6e0b03f949ba40684f868c63a08d89177b1 +ENV GDAL_GIT_HASH 0c57764ec2040c4e53c0313844ea5afccdc00279 RUN set -ex \ && cd /usr/src \ && git clone https://github.com/OSGeo/gdal.git \ @@ -301,11 +301,11 @@ COPY --from=builder /usr/local /usr/local ARG CGAL_GIT_BRANCH ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH} -ENV CGAL5X_GIT_HASH 188e51bad36ffc30e49dbabda29620b71a84664c -ENV SFCGAL_GIT_HASH 61f3b08ade49493b56c6bafa98c7c1f84addbc10 -ENV PROJ_GIT_HASH 356496f7b60ee0235189dd51d99aac700fbd2bdc -ENV GEOS_GIT_HASH a8d2ed0aba46f88f9b8987526e68eea6565d16ae -ENV GDAL_GIT_HASH d7aed6e0b03f949ba40684f868c63a08d89177b1 +ENV CGAL5X_GIT_HASH dfa981a844c121f4407e1f83092ccc533197b932 +ENV SFCGAL_GIT_HASH a976da3b52692f4d3c30c898eac80673f8507b6d +ENV PROJ_GIT_HASH cce46228bde5b7dfa6d3b9048865f43dfbbeda30 +ENV GEOS_GIT_HASH 42546119c35e65aad72dea1477eb4a057ead631e +ENV GDAL_GIT_HASH 0c57764ec2040c4e53c0313844ea5afccdc00279 # 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 8ed84517a9b86c86724504d1b6a0f0c1ccd86cf6 +ENV POSTGIS_GIT_HASH 95c525d310b783db4a52d85506ef3cc713238683 RUN set -ex \ && apt-get update \ diff --git a/17beta2-master/initdb-postgis.sh b/17beta2-master/initdb-postgis.sh new file mode 100644 index 00000000..e38ad7d6 --- /dev/null +++ b/17beta2-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/17beta2-master/update-postgis.sh b/17beta2-master/update-postgis.sh new file mode 100755 index 00000000..f98abd26 --- /dev/null +++ b/17beta2-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/README.md b/README.md index 6f592e2b..98ae5405 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ 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-02-17) +# Versions (2024-07-19) Supported architecture: `amd64` (also known as X86-64)" @@ -63,7 +63,10 @@ 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.18 | 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:17beta2-3.5.0alpha2-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17beta2-3.5.0alpha2-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17beta2-3.5.0alpha2/alpine/Dockerfile) | alpine:3.18 | 17beta2 | 3.5.0alpha2 | +| [postgis/postgis:17beta2-master](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17beta2-master) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17beta2-master/Dockerfile) | debian:bullseye | 17beta2 | development: postgis, geos, proj, gdal | ## Usage diff --git a/update.sh b/update.sh index 62733e88..3f24fefa 100755 --- a/update.sh +++ b/update.sh @@ -35,6 +35,7 @@ declare -A debianSuite=( [14]='bullseye-slim' [15]='bullseye-slim' [16]='bullseye-slim' + [17]='bullseye-slim' ) defaultPostgisDebPkgNameVersionSuffix='3' @@ -44,6 +45,7 @@ declare -A postgisDebPkgNameVersionSuffixes=( [3.2]='3' [3.3]='3' [3.4]='3' + [3.5]='3' ) packagesBase='http://apt.postgresql.org/pub/repos/apt/dists/' From 42d811c4d0e15c4ea6c99413f61b8713932a3e4e Mon Sep 17 00:00:00 2001 From: ImreSamu Date: Sat, 20 Jul 2024 11:37:45 +0200 Subject: [PATCH 3/3] upgrade to alpine3.20 --- 12-3.4/alpine/Dockerfile | 2 +- 13-3.4/alpine/Dockerfile | 2 +- 14-3.4/alpine/Dockerfile | 2 +- 15-3.4/alpine/Dockerfile | 2 +- 16-3.4/alpine/Dockerfile | 2 +- 16-3.5.0alpha2/alpine/Dockerfile | 2 +- 17beta2-3.5.0alpha2/alpine/Dockerfile | 2 +- Dockerfile.alpine.template | 2 +- README.md | 20 ++++++++++---------- update.sh | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/12-3.4/alpine/Dockerfile b/12-3.4/alpine/Dockerfile index 4c54aab0..bfb3a972 100644 --- a/12-3.4/alpine/Dockerfile +++ b/12-3.4/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:12-alpine3.18 +ARG BASE_IMAGE=postgres:12-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/13-3.4/alpine/Dockerfile b/13-3.4/alpine/Dockerfile index 1a2df47c..faf73cc6 100644 --- a/13-3.4/alpine/Dockerfile +++ b/13-3.4/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:13-alpine3.18 +ARG BASE_IMAGE=postgres:13-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/14-3.4/alpine/Dockerfile b/14-3.4/alpine/Dockerfile index 20cd1055..6caa6f6b 100644 --- a/14-3.4/alpine/Dockerfile +++ b/14-3.4/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:14-alpine3.18 +ARG BASE_IMAGE=postgres:14-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/15-3.4/alpine/Dockerfile b/15-3.4/alpine/Dockerfile index c39f5e94..9c27367d 100644 --- a/15-3.4/alpine/Dockerfile +++ b/15-3.4/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:15-alpine3.18 +ARG BASE_IMAGE=postgres:15-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/16-3.4/alpine/Dockerfile b/16-3.4/alpine/Dockerfile index 010d240e..ffc4b23e 100644 --- a/16-3.4/alpine/Dockerfile +++ b/16-3.4/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:16-alpine3.18 +ARG BASE_IMAGE=postgres:16-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/16-3.5.0alpha2/alpine/Dockerfile b/16-3.5.0alpha2/alpine/Dockerfile index b45e796c..19044463 100644 --- a/16-3.5.0alpha2/alpine/Dockerfile +++ b/16-3.5.0alpha2/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:16-alpine3.18 +ARG BASE_IMAGE=postgres:16-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/17beta2-3.5.0alpha2/alpine/Dockerfile b/17beta2-3.5.0alpha2/alpine/Dockerfile index d05aa8cf..47cf0a96 100644 --- a/17beta2-3.5.0alpha2/alpine/Dockerfile +++ b/17beta2-3.5.0alpha2/alpine/Dockerfile @@ -1,7 +1,7 @@ # # NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. # -ARG BASE_IMAGE=postgres:17beta2-alpine3.18 +ARG BASE_IMAGE=postgres:17beta2-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/Dockerfile.alpine.template b/Dockerfile.alpine.template index 8ed94dd7..a2c92db3 100644 --- a/Dockerfile.alpine.template +++ b/Dockerfile.alpine.template @@ -1,7 +1,7 @@ # # %%TXT_AUTOGENERATED%% # -ARG BASE_IMAGE=postgres:%%PG_MAJOR%%-alpine3.18 +ARG BASE_IMAGE=postgres:%%PG_MAJOR%%-alpine3.20 FROM ${BASE_IMAGE} LABEL maintainer="PostGIS Project - https://postgis.net" \ diff --git a/README.md b/README.md index 98ae5405..582671c2 100644 --- a/README.md +++ b/README.md @@ -43,31 +43,31 @@ Recommended version for new users: `postgis/postgis:16-3.4` ### 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.18 version, the package versions are: geos=3.11, gdal=3.6, proj=9.2, and sfcgal=1.4. +* 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 * 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.18 | 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.18 | 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.18 | 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.18 | 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.18 | 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.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 | ### Test images * We provide alpha, beta, release candidate (rc), and development (identified as ~master) versions. * The template for the `*-master` images is updated manually, which might lead to a delay of a few weeks sometimes. -* The ~master SFCGAL version is 1.5 or higher. The cgal version is locked on the [5.6.x-branch](https://github.com/CGAL/cgal/tree/5.6.x-branch). +* The ~master SFCGAL version is 1.5.1 or higher. The cgal version is locked on the [5.6.x-branch](https://github.com/CGAL/cgal/tree/5.6.x-branch). | 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.18 | 16 | 3.5.0alpha2 | +| [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:17beta2-3.5.0alpha2-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17beta2-3.5.0alpha2-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17beta2-3.5.0alpha2/alpine/Dockerfile) | alpine:3.18 | 17beta2 | 3.5.0alpha2 | +| [postgis/postgis:17beta2-3.5.0alpha2-alpine](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17beta2-3.5.0alpha2-alpine) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17beta2-3.5.0alpha2/alpine/Dockerfile) | alpine:3.20 | 17beta2 | 3.5.0alpha2 | | [postgis/postgis:17beta2-master](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name=17beta2-master) | [Dockerfile](https://github.com/postgis/docker-postgis/blob/master/17beta2-master/Dockerfile) | debian:bullseye | 17beta2 | 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 3f24fefa..f9f88934 100755 --- a/update.sh +++ b/update.sh @@ -25,7 +25,7 @@ githubrepolink="https://github.com/postgis/docker-postgis/blob/master" # sort version numbers with highest last (so it goes first in .travis.yml) IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -V) ); unset IFS -defaultAlpinenSuite='3.18' +defaultAlpinenSuite='3.20' defaultDebianSuite='bullseye-slim' declare -A debianSuite=( # https://github.com/docker-library/postgres/issues/582