Skip to content

Commit 112a585

Browse files
WarpSQL: Add support and improvements for PostGIS extension
1. Added support for PostGIS extension 2. PG15_POSTGIS_3.1.0
1 parent 1f1cbc1 commit 112a585

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,44 @@ RUN set -ex \
131131
&& cd ~ \
132132
&& rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \
133133
&& apk del .citus-deps .citus-build-deps
134+
135+
## Adding PostGIS
136+
# Install PostGIS dependencies
137+
RUN apk add --no-cache --virtual .postgis-deps \
138+
geos-dev \
139+
gdal-dev \
140+
proj-dev \
141+
curl \
142+
json-c-dev \
143+
protobuf-c-dev
144+
145+
# Install PostGIS
146+
ARG POSTGIS_VERSION
147+
RUN set -ex \
148+
&& apk add --no-cache --virtual .postgis-build-deps \
149+
gcc \
150+
g++ \
151+
libc-dev \
152+
make \
153+
libxml2-dev \
154+
musl-dev \
155+
perl \
156+
clang \
157+
geos-dev \
158+
gdal-dev \
159+
proj-dev \
160+
protobuf-c-dev \
161+
llvm15-dev \
162+
json-c-dev \
163+
&& POSTGIS_DOWNLOAD_URL="https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz" \
164+
&& curl -L -o /tmp/postgis.tar.gz "${POSTGIS_DOWNLOAD_URL}" \
165+
&& tar -C /tmp -xvf /tmp/postgis.tar.gz \
166+
&& chown -R postgres:postgres /tmp/postgis-${POSTGIS_VERSION} \
167+
&& cd /tmp/postgis-${POSTGIS_VERSION} \
168+
&& PATH="/usr/local/pgsql/bin:$PATH" ./configure \
169+
&& make \
170+
&& make install \
171+
&& cd ~ \
172+
&& rm -rf /tmp/postgis.tar.gz /tmp/postgis-${POSTGIS_VERSION} \
173+
&& apk del .postgis-deps .postgis-build-deps
174+

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ NAME=postgres
44
ORG=samagragovernance
55
PG_VER=pg15
66
CITUS_VERSION="11.2.0"
7+
POSTGIS_VERSION=3.1.4
78
PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-)
89
TS_VERSION=main
910
PREV_TS_VERSION=$(shell wget --quiet -O - https://raw.githubusercontent.com/timescale/timescaledb/${TS_VERSION}/version.config | grep update_from_version | sed -e 's!update_from_version = !!')
@@ -55,7 +56,7 @@ default: image
5556
touch .build_$(TS_VERSION)_$(PG_VER)_oss
5657

5758
.build_$(TS_VERSION)_$(PG_VER): Dockerfile
58-
docker build --build-arg PG_VERSION=$(PG_VER_NUMBER) --build-arg TS_VERSION=$(TS_VERSION) --build-arg PREV_IMAGE=$(PREV_IMAGE) --build-arg CITUS_VERSION=$(CITUS_VERSION) $(TAG) .
59+
docker build --build-arg PG_VERSION=$(PG_VER_NUMBER) --build-arg TS_VERSION=$(TS_VERSION) --build-arg PREV_IMAGE=$(PREV_IMAGE) --build-arg CITUS_VERSION=$(CITUS_VERSION) --build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) $(TAG) .
5960
touch .build_$(TS_VERSION)_$(PG_VER)
6061

6162
image: .build_$(TS_VERSION)_$(PG_VER)

0 commit comments

Comments
 (0)