1
1
#
2
2
# NOTE: THIS DOCKERFILE IS GENERATED VIA "make update"! PLEASE DO NOT EDIT IT DIRECTLY.
3
3
#
4
- ARG BASE_IMAGE=postgres:11-alpine3.17
4
+ ARG BASE_IMAGE=postgres:11-alpine3.18
5
5
FROM ${BASE_IMAGE}
6
6
7
7
LABEL maintainer="PostGIS Project - https://postgis.net" \
@@ -12,43 +12,6 @@ ENV POSTGIS_VERSION 3.3.2
12
12
ENV POSTGIS_SHA256 2a6858d1df06de1c5f85a5b780773e92f6ba3a5dc09ac31120ac895242f5a77b
13
13
14
14
RUN set -eux \
15
- \
16
- && if [ $(printf %.1s "$POSTGIS_VERSION" ) == 3 ]; then \
17
- set -eux ; \
18
- #
19
- # using only v3.17
20
- #
21
- # GEOS: https://pkgs.alpinelinux.org/packages?name=geos&branch=v3.17 \
22
- export GEOS_ALPINE_VER=3.11 ; \
23
- # GDAL: https://pkgs.alpinelinux.org/packages?name=gdal&branch=v3.17 \
24
- export GDAL_ALPINE_VER=3.5 ; \
25
- # PROJ: https://pkgs.alpinelinux.org/packages?name=proj&branch=v3.17 \
26
- export PROJ_ALPINE_VER=9.1 ; \
27
- #
28
- elif [ $(printf %.1s "$POSTGIS_VERSION" ) == 2 ]; then \
29
- set -eux ; \
30
- #
31
- # using older branches v3.13; v3.14 for GEOS,GDAL,PROJ
32
- #
33
- # GEOS: https://pkgs.alpinelinux.org/packages?name=geos&branch=v3.13 \
34
- export GEOS_ALPINE_VER=3.8 ; \
35
- # GDAL: https://pkgs.alpinelinux.org/packages?name=gdal&branch=v3.14 \
36
- export GDAL_ALPINE_VER=3.2 ; \
37
- # PROJ: https://pkgs.alpinelinux.org/packages?name=proj&branch=v3.14 \
38
- export PROJ_ALPINE_VER=7.2 ; \
39
- #
40
- \
41
- echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/main' >> /etc/apk/repositories ; \
42
- echo 'https://dl-cdn.alpinelinux.org/alpine/v3.14/community' >> /etc/apk/repositories ; \
43
- echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories ; \
44
- echo 'https://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories ; \
45
- \
46
- else \
47
- set -eux ; \
48
- echo ".... unknown \$ POSTGIS_VERSION ...." ; \
49
- exit 1 ; \
50
- fi \
51
- \
52
15
&& apk add --no-cache --virtual .fetch-deps \
53
16
ca-certificates \
54
17
openssl \
@@ -66,13 +29,19 @@ RUN set -eux \
66
29
\
67
30
&& apk add --no-cache --virtual .build-deps \
68
31
\
69
- gdal-dev~=${GDAL_ALPINE_VER} \
70
- geos-dev~=${GEOS_ALPINE_VER} \
71
- proj-dev~=${PROJ_ALPINE_VER} \
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 \
72
42
\
73
43
autoconf \
74
44
automake \
75
- clang-dev \
76
45
cunit-dev \
77
46
file \
78
47
g++ \
@@ -82,36 +51,38 @@ RUN set -eux \
82
51
json-c-dev \
83
52
libtool \
84
53
libxml2-dev \
85
- llvm-dev \
86
54
make \
87
- pcre -dev \
55
+ pcre2 -dev \
88
56
perl \
89
57
protobuf-c-dev \
90
58
\
91
- # build PostGIS
92
- \
59
+ # build PostGIS - with Link Time Optimization (LTO) enabled
93
60
&& cd /usr/src/postgis \
94
61
&& gettextize \
95
62
&& ./autogen.sh \
96
63
&& ./configure \
97
- --with-pcredir= "$(pcre-config --prefix)" \
64
+ --enable-lto \
98
65
&& make -j$(nproc) \
99
66
&& make install \
100
67
\
101
- # regress check
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.
102
76
&& mkdir /tempdb \
103
77
&& chown -R postgres:postgres /tempdb \
104
78
&& su postgres -c 'pg_ctl -D /tempdb init' \
105
79
&& su postgres -c 'pg_ctl -D /tempdb start' \
106
80
&& cd regress \
107
81
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
108
- # && make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \
109
- # && make garden PGUSER=postgres \
110
82
\
111
83
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
112
84
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \
113
- # # sfcgal expected with the next alpine release : 3.18
114
- # && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_sfcgal;"' \
85
+ && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_sfcgal;"' \
115
86
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; --needed for postgis_tiger_geocoder "' \
116
87
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer;"' \
117
88
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS address_standardizer_data_us;"' \
@@ -127,13 +98,14 @@ RUN set -eux \
127
98
# add .postgis-rundeps
128
99
&& apk add --no-cache --virtual .postgis-rundeps \
129
100
\
130
- gdal~=${GDAL_ALPINE_VER} \
131
- geos~=${GEOS_ALPINE_VER} \
132
- proj~=${PROJ_ALPINE_VER} \
101
+ gdal \
102
+ geos \
103
+ proj \
104
+ sfcgal \
133
105
\
134
106
json-c \
135
107
libstdc++ \
136
- pcre \
108
+ pcre2 \
137
109
protobuf-c \
138
110
\
139
111
# ca-certificates: for accessing remote raster files
@@ -143,7 +115,8 @@ RUN set -eux \
143
115
&& cd / \
144
116
&& rm -rf /usr/src/postgis \
145
117
&& apk del .fetch-deps .build-deps \
146
- # print PostGIS_Full_Version() for the log. ( experimental & internal )
118
+ # At the end of the build, we print the collected information
119
+ # from the '/_pgis_full_version.txt' file. This is for experimental and internal purposes.
147
120
&& cat /_pgis_full_version.txt
148
121
149
122
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
0 commit comments