Skip to content
Merged
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
20 changes: 13 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
---
language: bash
services: docker

dist: trusty

env:
- VERSION=9.2-2.3
- VERSION=9.3-2.3
- VERSION=9.4-2.3
- VERSION=9.5-2.3
- VERSION=9.6-2.3
- VERSION=9.6-2.3 VARIANT=alpine
- VERSION=9.5-2.3
- VERSION=9.5-2.3 VARIANT=alpine
- VERSION=9.4-2.3
- VERSION=9.4-2.3 VARIANT=alpine
- VERSION=9.3-2.3
- VERSION=9.3-2.3 VARIANT=alpine
- VERSION=9.2-2.3
- VERSION=9.2-2.3 VARIANT=alpine

install:
- git clone https://github.com/docker-library/official-images.git ~/official-images

before_script:
- env | sort
- cd "$VERSION"
- image="appropriate/postgis:$VERSION"
- cd "$VERSION/$VARIANT"
- image="appropriate/postgis:$VERSION${VARIANT:+-${VARIANT}}"

script:
- docker build --pull -t "$image" .
- ~/official-images/test/run.sh -c ~/official-images/test/config.sh -c ../test/postgis-config.sh "$image"
- ~/official-images/test/run.sh -c ~/official-images/test/config.sh -c "../${VARIANT:+../}test/postgis-config.sh" "$image"
58 changes: 58 additions & 0 deletions 9.2-2.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM postgres:9.2-alpine
MAINTAINER Régis Belson <me@regisbelson.fr>

ENV POSTGIS_VERSION 2.3.1
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8

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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gdal-dev \
geos-dev \
proj4-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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
geos \
gdal \
proj4 \
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps .build-deps-testing

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
23 changes: 23 additions & 0 deletions 9.2-2.3/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/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_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
58 changes: 58 additions & 0 deletions 9.3-2.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM postgres:9.3-alpine
MAINTAINER Régis Belson <me@regisbelson.fr>

ENV POSTGIS_VERSION 2.3.1
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8

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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gdal-dev \
geos-dev \
proj4-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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
geos \
gdal \
proj4 \
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps .build-deps-testing

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
23 changes: 23 additions & 0 deletions 9.3-2.3/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/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_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
58 changes: 58 additions & 0 deletions 9.4-2.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM postgres:9.4-alpine
MAINTAINER Régis Belson <me@regisbelson.fr>

ENV POSTGIS_VERSION 2.3.1
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8

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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gdal-dev \
geos-dev \
proj4-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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
geos \
gdal \
proj4 \
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps .build-deps-testing

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
23 changes: 23 additions & 0 deletions 9.4-2.3/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/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_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
58 changes: 58 additions & 0 deletions 9.5-2.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM postgres:9.5-alpine
MAINTAINER Régis Belson <me@regisbelson.fr>

ENV POSTGIS_VERSION 2.3.1
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8

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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gdal-dev \
geos-dev \
proj4-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-testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
geos \
gdal \
proj4 \
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps .build-deps-testing

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh
23 changes: 23 additions & 0 deletions 9.5-2.3/alpine/initdb-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/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_topology;
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
EOSQL
done
Loading