Skip to content

Postgis 3.0.0alpha3 #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ services: docker
dist: trusty

env:
- VERSION=12.0beta2-3.0.0alpha3 VARIANT=alpine
- VERSION=11-2.5
- VERSION=11-2.5 VARIANT=alpine
- VERSION=10-2.5
- VERSION=10-2.5 VARIANT=alpine
- VERSION=9.6-2.5
- VERSION=9.6-2.5 VARIANT=alpine
- VERSION=9.5-2.5
- VERSION=9.5-2.5 VARIANT=alpine
- VERSION=9.4-2.5
- VERSION=9.4-2.5 VARIANT=alpine
- VERSION=11-2.5
- VERSION=11-2.5 VARIANT=alpine
- VERSION=10-2.5
- VERSION=10-2.5 VARIANT=alpine

install:
- git clone https://github.com/docker-library/official-images.git ~/official-images
Expand Down
4 changes: 2 additions & 2 deletions 10-2.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN set -ex \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj4-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
Expand All @@ -53,7 +53,7 @@ RUN set -ex \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj4 \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
Expand Down
10 changes: 5 additions & 5 deletions 11-2.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN set -ex \
perl \
\
&& apk add --no-cache --virtual .build-deps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj4-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
Expand All @@ -49,11 +49,11 @@ RUN set -ex \
&& apk add --no-cache --virtual .postgis-rundeps \
json-c \
&& apk add --no-cache --virtual .postgis-rundeps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj4 \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
Expand Down
62 changes: 62 additions & 0 deletions 12.0beta2-3.0.0alpha3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM postgres:12-beta2-alpine

ENV POSTGIS_VERSION 3.0.0alpha3
ENV POSTGIS_SHA256 b75e28139fe74158a27b7e7b2d1c2c0a7acb3abe8c60cfc72d45b0827dd12364

RUN set -ex \
\
&& 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 \
autoconf \
automake \
g++ \
json-c-dev \
libtool \
libxml2-dev \
make \
perl \
\
&& apk add --no-cache --virtual .build-deps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
&& ./configure \
# --with-gui \
&& make \
&& make install \
&& apk add --no-cache --virtual .postgis-rundeps \
json-c \
&& apk add --no-cache --virtual .postgis-rundeps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps .build-deps-edge

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
COPY ./update-postgis.sh /usr/local/bin
24 changes: 24 additions & 0 deletions 12.0beta2-3.0.0alpha3/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

# Create the 'template_postgis' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_postgis;
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
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_raster;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
28 changes: 28 additions & 0 deletions 12.0beta2-3.0.0alpha3/alpine/update-postgis.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions 9.4-2.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN set -ex \
perl \
\
&& apk add --no-cache --virtual .build-deps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj4-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
Expand All @@ -49,11 +49,11 @@ RUN set -ex \
&& apk add --no-cache --virtual .postgis-rundeps \
json-c \
&& apk add --no-cache --virtual .postgis-rundeps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj4 \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
Expand Down
4 changes: 2 additions & 2 deletions 9.5-2.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN set -ex \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj4-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
Expand All @@ -53,7 +53,7 @@ RUN set -ex \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj4 \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
Expand Down
10 changes: 5 additions & 5 deletions 9.6-2.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN set -ex \
perl \
\
&& apk add --no-cache --virtual .build-deps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj4-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
Expand All @@ -49,11 +49,11 @@ RUN set -ex \
&& apk add --no-cache --virtual .postgis-rundeps \
json-c \
&& apk add --no-cache --virtual .postgis-rundeps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj4 \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile.alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN set -ex \
perl \
\
&& apk add --no-cache --virtual .build-deps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal-dev \
geos-dev \
proj4-dev \
proj-dev \
protobuf-c-dev \
&& cd /usr/src/postgis \
&& ./autogen.sh \
Expand All @@ -49,11 +49,11 @@ RUN set -ex \
&& apk add --no-cache --virtual .postgis-rundeps \
json-c \
&& apk add --no-cache --virtual .postgis-rundeps-edge \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
geos \
gdal \
proj4 \
proj \
protobuf-c \
&& cd / \
&& rm -rf /usr/src/postgis \
Expand Down