|
| 1 | +# |
| 2 | +# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY. |
| 3 | +# |
| 4 | +ARG BASE_IMAGE=postgres:17-alpine3.21 |
| 5 | +FROM ${BASE_IMAGE} |
| 6 | + |
| 7 | +LABEL maintainer="PostGIS Project - https://postgis.net" \ |
| 8 | + org.opencontainers.image.description="PostGIS 3.6.0alpha1 spatial database extension with PostgreSQL 17 Alpine" \ |
| 9 | + org.opencontainers.image.source="https://github.com/postgis/docker-postgis" |
| 10 | + |
| 11 | +ENV POSTGIS_VERSION 3.6.0alpha1 |
| 12 | +ENV POSTGIS_SHA256 9f1981716001afff2e4ec75e4107cb64e8d3d9d26ad2abf573444038db0830eb |
| 13 | + |
| 14 | +RUN set -eux \ |
| 15 | + && apk add --no-cache --virtual .fetch-deps \ |
| 16 | + ca-certificates \ |
| 17 | + openssl \ |
| 18 | + tar \ |
| 19 | + \ |
| 20 | + && wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/${POSTGIS_VERSION}.tar.gz" \ |
| 21 | + && echo "${POSTGIS_SHA256} *postgis.tar.gz" | sha256sum -c - \ |
| 22 | + && mkdir -p /usr/src/postgis \ |
| 23 | + && tar \ |
| 24 | + --extract \ |
| 25 | + --file postgis.tar.gz \ |
| 26 | + --directory /usr/src/postgis \ |
| 27 | + --strip-components 1 \ |
| 28 | + && rm postgis.tar.gz \ |
| 29 | + \ |
| 30 | + && apk add --no-cache --virtual .build-deps \ |
| 31 | + \ |
| 32 | + gdal-dev \ |
| 33 | + geos-dev \ |
| 34 | + proj-dev \ |
| 35 | + proj-util \ |
| 36 | + sfcgal-dev \ |
| 37 | + \ |
| 38 | + # The upstream variable, '$DOCKER_PG_LLVM_DEPS' contains |
| 39 | + # the correct versions of 'llvm-dev' and 'clang' for the current version of PostgreSQL. |
| 40 | + # This improvement has been discussed in https://github.com/docker-library/postgres/pull/1077 |
| 41 | + $DOCKER_PG_LLVM_DEPS \ |
| 42 | + \ |
| 43 | + autoconf \ |
| 44 | + automake \ |
| 45 | + cunit-dev \ |
| 46 | + file \ |
| 47 | + g++ \ |
| 48 | + gcc \ |
| 49 | + gettext-dev \ |
| 50 | + git \ |
| 51 | + json-c-dev \ |
| 52 | + libtool \ |
| 53 | + libxml2-dev \ |
| 54 | + make \ |
| 55 | + pcre2-dev \ |
| 56 | + perl \ |
| 57 | + protobuf-c-dev \ |
| 58 | + \ |
| 59 | +# build PostGIS - with Link Time Optimization (LTO) enabled |
| 60 | + && cd /usr/src/postgis \ |
| 61 | + && gettextize \ |
| 62 | + && ./autogen.sh \ |
| 63 | + && ./configure \ |
| 64 | + --enable-lto \ |
| 65 | + && make -j$(nproc) \ |
| 66 | + && make install \ |
| 67 | + \ |
| 68 | +# This section is for refreshing the proj data for the regression tests. |
| 69 | +# It serves as a workaround for an issue documented at https://trac.osgeo.org/postgis/ticket/5316 |
| 70 | +# This increases the Docker image size by about 1 MB. |
| 71 | + && projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \ |
| 72 | + && projsync --system-directory --file us_noaa_eshpgn \ |
| 73 | + && projsync --system-directory --file us_noaa_prvi \ |
| 74 | + && projsync --system-directory --file us_noaa_wmhpgn \ |
| 75 | +# This section performs a regression check. |
| 76 | + && mkdir /tempdb \ |
| 77 | + && chown -R postgres:postgres /tempdb \ |
| 78 | + && su postgres -c 'pg_ctl -D /tempdb init' \ |
| 79 | + && su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \ |
| 80 | + && cd regress \ |
| 81 | + && make -j$(nproc) check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \ |
| 82 | + \ |
| 83 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \ |
| 84 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \ |
| 85 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_sfcgal;"' \ |
| 86 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; --needed for postgis_tiger_geocoder "' \ |
| 87 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer;"' \ |
| 88 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \ |
| 89 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;"' \ |
| 90 | + && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"' \ |
| 91 | + && su postgres -c 'psql -t -c "SELECT version();"' >> /_pgis_full_version.txt \ |
| 92 | + && su postgres -c 'psql -t -c "SELECT PostGIS_Full_Version();"' >> /_pgis_full_version.txt \ |
| 93 | + && su postgres -c 'psql -t -c "\dx"' >> /_pgis_full_version.txt \ |
| 94 | + \ |
| 95 | + && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ |
| 96 | + && rm -rf /tempdb \ |
| 97 | + && rm -rf /tmp/logfile \ |
| 98 | + && rm -rf /tmp/pgis_reg \ |
| 99 | +# add .postgis-rundeps |
| 100 | + && apk add --no-cache --virtual .postgis-rundeps \ |
| 101 | + \ |
| 102 | + gdal \ |
| 103 | + geos \ |
| 104 | + proj \ |
| 105 | + sfcgal \ |
| 106 | + \ |
| 107 | + json-c \ |
| 108 | + libstdc++ \ |
| 109 | + pcre2 \ |
| 110 | + protobuf-c \ |
| 111 | + \ |
| 112 | + # ca-certificates: for accessing remote raster files |
| 113 | + # fix https://github.com/postgis/docker-postgis/issues/307 |
| 114 | + ca-certificates \ |
| 115 | +# clean |
| 116 | + && cd / \ |
| 117 | + && rm -rf /usr/src/postgis \ |
| 118 | + && apk del .fetch-deps .build-deps \ |
| 119 | +# At the end of the build, we print the collected information |
| 120 | +# from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes. |
| 121 | + && cat /_pgis_full_version.txt |
| 122 | + |
| 123 | +COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh |
| 124 | +COPY ./update-postgis.sh /usr/local/bin |
0 commit comments