Skip to content

Commit 8a1955b

Browse files
TomPohysfrancois2metz
authored andcommitted
Upgrade to PostgreSQL 14 (openmaptiles#413)
This PR is upgrading PostgreSQL from 9.6 to 14. GEOS 3.9.0 is used in Debian-bullseye image for building [postgis:14-3.2](https://github.com/postgis/docker-postgis/blob/master/14-3.2/Dockerfile#L1). I kept the code for the eventual manual update of GEOS. There is also tune-up PostgreSQL to turn off `jit` which prolongs the `import-sql` step in OpenMapTiles.
1 parent 3e9f966 commit 8a1955b

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN set -eux ;\
1919
go get github.com/tools/godep ;\
2020
mkdir /build-bin ;\
2121
\
22-
/bin/bash -c 'echo ""; echo ""; echo "##### Build imposm3 -- https://github.com/osm2vectortiles/imposm3"' >&2 ;\
22+
/bin/bash -c 'echo ""; echo ""; echo "##### Build imposm3 -- $IMPOSM_REPO in version $IMPOSM_VERSION"' >&2 ;\
2323
#
2424
# get and build specific version of imposm
2525
git clone --quiet --depth 1 $IMPOSM_REPO -b $IMPOSM_VERSION \
@@ -63,7 +63,7 @@ RUN set -eux ;\
6363
FROM python:3.9-slim
6464
LABEL maintainer="Yuri Astrakhan <[email protected]>"
6565

66-
ARG PG_MAJOR=12
66+
ARG PG_MAJOR=14
6767
ARG TOOLS_DIR=/usr/src/app
6868

6969
WORKDIR ${TOOLS_DIR}
@@ -115,15 +115,15 @@ RUN set -eux ;\
115115
libprotobuf-dev \
116116
;\
117117
# generate-tiles
118-
curl -sL https://deb.nodesource.com/setup_12.x | bash - ;\
118+
curl -sL https://deb.nodesource.com/setup_14.x | bash - ;\
119119
DEBIAN_FRONTEND=noninteractive apt-get update ;\
120120
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
121121
nodejs build-essential ;\
122122
rm -rf /var/lib/apt/lists/ ;\
123123
npm config set unsafe-perm true ;\
124124
npm install -g \
125125
126-
@mapbox/[email protected].0 \
126+
@mapbox/[email protected].1 \
127127
128128
\
129129
/bin/bash -c 'echo ""; echo ""; echo "##### Cleaning up"' >&2 ;\

docker/postgis/Dockerfile

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# the postgis base image has outdated ogr2ogr (gdal-bin package)
33
# does not support PG12 yet, which means postgis-preloaded cannot be built easily.
44
# Once it is updated, or there is a different way to build it, we can upgrade to 12.
5-
ARG BASE_POSTGIS_VER=12-3.1
5+
ARG BASE_POSTGIS_VER=14-3.2
66
FROM postgis/postgis:$BASE_POSTGIS_VER
77

88
LABEL maintainer="Yuri Astrakhan <[email protected]>"
99

1010
# https://github.com/libgeos/geos/releases
11-
ARG GEOS_VER=3.9.1
11+
#ARG GEOS_VER=3.9.3
1212

1313
# https://github.com/pramsey/pgsql-gzip/releases
1414
ARG PGSQL_GZIP_TAG=v1.0.0
@@ -40,15 +40,15 @@ RUN set -eux ;\
4040
libgdal-dev \
4141
;\
4242
## Install specific GEOS version
43-
cd /opt/ ;\
44-
curl -o /opt/geos.tar.bz2 http://download.osgeo.org/geos/geos-${GEOS_VER}.tar.bz2 ;\
45-
mkdir /opt/geos ;\
46-
tar xf /opt/geos.tar.bz2 -C /opt/geos --strip-components=1 ;\
47-
cd /opt/geos/ ;\
48-
./configure ;\
49-
make -j ;\
50-
make install ;\
51-
rm -rf /opt/geos* ;\
43+
#cd /opt/ ;\
44+
#curl -o /opt/geos.tar.bz2 http://download.osgeo.org/geos/geos-${GEOS_VER}.tar.bz2 ;\
45+
#mkdir /opt/geos ;\
46+
#tar xf /opt/geos.tar.bz2 -C /opt/geos --strip-components=1 ;\
47+
#cd /opt/geos/ ;\
48+
#./configure ;\
49+
#make -j ;\
50+
#make install ;\
51+
#rm -rf /opt/geos* ;\
5252
##
5353
## gzip extension
5454
cd /opt/ ;\

docker/postgis/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PostGIS + OSM-specific extensions Docker image
2-
[![](https://images.microbadger.com/badges/image/openmaptiles/postgis.svg)](https://microbadger.com/images/openmaptiles/postgis "Get your own image badge on microbadger.com") [![Docker Automated buil](https://img.shields.io/docker/automated/openmaptiles/postgis.svg)]()
2+
[![Docker Automated build](https://img.shields.io/docker/automated/openmaptiles/postgis.svg)]()
33

4-
This images is based on PostgreSQL 9.6 and PostGIS 3.0 [Docker image](https://hub.docker.com/r/postgis/postgis/) and includes [osml10n extension](https://github.com/openmaptiles/mapnik-german-l10n.git) - OSM-specific label manipulation support.
4+
This images is based on PostgreSQL 14 and PostGIS 3.2 [Docker image](https://hub.docker.com/r/postgis/postgis/) and includes [osml10n extension](https://github.com/openmaptiles/mapnik-german-l10n.git) - OSM-specific label manipulation support.
55

66
## Usage
77

docker/postgis/initdb-postgis.sh

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ set -o errexit
33
set -o pipefail
44
set -o nounset
55

6+
# Tune-up performance for `make import-sql`
7+
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
8+
echo " Pre-configuring Postgres 14 system"
9+
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
10+
PGUSER="$POSTGRES_USER" "${psql[@]}" --dbname="$POSTGRES_DB" <<-'EOSQL'
11+
ALTER SYSTEM SET jit = 'off';
12+
EOSQL
13+
614
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
715
echo " Loading OMT postgis extensions"
816
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

0 commit comments

Comments
 (0)