Skip to content

Commit 060ada9

Browse files
authored
Merge pull request #49 from kurlzor/add-alpine-variants
Add alpine variants for all versions
2 parents 4014d78 + 38fd15a commit 060ada9

File tree

14 files changed

+498
-8
lines changed

14 files changed

+498
-8
lines changed

.travis.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
---
22
language: bash
3+
services: docker
34

45
dist: trusty
56

67
env:
7-
- VERSION=9.2-2.3
8-
- VERSION=9.3-2.3
9-
- VERSION=9.4-2.3
10-
- VERSION=9.5-2.3
118
- VERSION=9.6-2.3
9+
- VERSION=9.6-2.3 VARIANT=alpine
10+
- VERSION=9.5-2.3
11+
- VERSION=9.5-2.3 VARIANT=alpine
12+
- VERSION=9.4-2.3
13+
- VERSION=9.4-2.3 VARIANT=alpine
14+
- VERSION=9.3-2.3
15+
- VERSION=9.3-2.3 VARIANT=alpine
16+
- VERSION=9.2-2.3
17+
- VERSION=9.2-2.3 VARIANT=alpine
1218

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

1622
before_script:
1723
- env | sort
18-
- cd "$VERSION"
19-
- image="appropriate/postgis:$VERSION"
24+
- cd "$VERSION/$VARIANT"
25+
- image="appropriate/postgis:$VERSION${VARIANT:+-${VARIANT}}"
2026

2127
script:
2228
- docker build --pull -t "$image" .
23-
- ~/official-images/test/run.sh -c ~/official-images/test/config.sh -c ../test/postgis-config.sh "$image"
29+
- ~/official-images/test/run.sh -c ~/official-images/test/config.sh -c "../${VARIANT:+../}test/postgis-config.sh" "$image"

9.2-2.3/alpine/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM postgres:9.2-alpine
2+
MAINTAINER Régis Belson <[email protected]>
3+
4+
ENV POSTGIS_VERSION 2.3.1
5+
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8
6+
7+
RUN set -ex \
8+
\
9+
&& apk add --no-cache --virtual .fetch-deps \
10+
ca-certificates \
11+
openssl \
12+
tar \
13+
\
14+
&& wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
15+
&& echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
16+
&& mkdir -p /usr/src/postgis \
17+
&& tar \
18+
--extract \
19+
--file postgis.tar.gz \
20+
--directory /usr/src/postgis \
21+
--strip-components 1 \
22+
&& rm postgis.tar.gz \
23+
\
24+
&& apk add --no-cache --virtual .build-deps \
25+
autoconf \
26+
automake \
27+
g++ \
28+
json-c-dev \
29+
libtool \
30+
libxml2-dev \
31+
make \
32+
perl \
33+
\
34+
&& apk add --no-cache --virtual .build-deps-testing \
35+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
36+
gdal-dev \
37+
geos-dev \
38+
proj4-dev \
39+
&& cd /usr/src/postgis \
40+
&& ./autogen.sh \
41+
# configure options taken from:
42+
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
43+
&& ./configure \
44+
# --with-gui \
45+
&& make \
46+
&& make install \
47+
&& apk add --no-cache --virtual .postgis-rundeps \
48+
json-c \
49+
&& apk add --no-cache --virtual .postgis-rundeps-testing \
50+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
51+
geos \
52+
gdal \
53+
proj4 \
54+
&& cd / \
55+
&& rm -rf /usr/src/postgis \
56+
&& apk del .fetch-deps .build-deps .build-deps-testing
57+
58+
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh

9.2-2.3/alpine/initdb-postgis.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Perform all actions as $POSTGRES_USER
6+
export PGUSER="$POSTGRES_USER"
7+
8+
# Create the 'template_postgis' template db
9+
"${psql[@]}" <<- 'EOSQL'
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
12+
EOSQL
13+
14+
# Load PostGIS into both template_database and $POSTGRES_DB
15+
for DB in template_postgis "$POSTGRES_DB"; do
16+
echo "Loading PostGIS extensions into $DB"
17+
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
18+
CREATE EXTENSION IF NOT EXISTS postgis;
19+
CREATE EXTENSION IF NOT EXISTS postgis_topology;
20+
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
21+
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
22+
EOSQL
23+
done

9.3-2.3/alpine/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM postgres:9.3-alpine
2+
MAINTAINER Régis Belson <[email protected]>
3+
4+
ENV POSTGIS_VERSION 2.3.1
5+
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8
6+
7+
RUN set -ex \
8+
\
9+
&& apk add --no-cache --virtual .fetch-deps \
10+
ca-certificates \
11+
openssl \
12+
tar \
13+
\
14+
&& wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
15+
&& echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
16+
&& mkdir -p /usr/src/postgis \
17+
&& tar \
18+
--extract \
19+
--file postgis.tar.gz \
20+
--directory /usr/src/postgis \
21+
--strip-components 1 \
22+
&& rm postgis.tar.gz \
23+
\
24+
&& apk add --no-cache --virtual .build-deps \
25+
autoconf \
26+
automake \
27+
g++ \
28+
json-c-dev \
29+
libtool \
30+
libxml2-dev \
31+
make \
32+
perl \
33+
\
34+
&& apk add --no-cache --virtual .build-deps-testing \
35+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
36+
gdal-dev \
37+
geos-dev \
38+
proj4-dev \
39+
&& cd /usr/src/postgis \
40+
&& ./autogen.sh \
41+
# configure options taken from:
42+
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
43+
&& ./configure \
44+
# --with-gui \
45+
&& make \
46+
&& make install \
47+
&& apk add --no-cache --virtual .postgis-rundeps \
48+
json-c \
49+
&& apk add --no-cache --virtual .postgis-rundeps-testing \
50+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
51+
geos \
52+
gdal \
53+
proj4 \
54+
&& cd / \
55+
&& rm -rf /usr/src/postgis \
56+
&& apk del .fetch-deps .build-deps .build-deps-testing
57+
58+
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh

9.3-2.3/alpine/initdb-postgis.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Perform all actions as $POSTGRES_USER
6+
export PGUSER="$POSTGRES_USER"
7+
8+
# Create the 'template_postgis' template db
9+
"${psql[@]}" <<- 'EOSQL'
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
12+
EOSQL
13+
14+
# Load PostGIS into both template_database and $POSTGRES_DB
15+
for DB in template_postgis "$POSTGRES_DB"; do
16+
echo "Loading PostGIS extensions into $DB"
17+
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
18+
CREATE EXTENSION IF NOT EXISTS postgis;
19+
CREATE EXTENSION IF NOT EXISTS postgis_topology;
20+
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
21+
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
22+
EOSQL
23+
done

9.4-2.3/alpine/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM postgres:9.4-alpine
2+
MAINTAINER Régis Belson <[email protected]>
3+
4+
ENV POSTGIS_VERSION 2.3.1
5+
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8
6+
7+
RUN set -ex \
8+
\
9+
&& apk add --no-cache --virtual .fetch-deps \
10+
ca-certificates \
11+
openssl \
12+
tar \
13+
\
14+
&& wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
15+
&& echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
16+
&& mkdir -p /usr/src/postgis \
17+
&& tar \
18+
--extract \
19+
--file postgis.tar.gz \
20+
--directory /usr/src/postgis \
21+
--strip-components 1 \
22+
&& rm postgis.tar.gz \
23+
\
24+
&& apk add --no-cache --virtual .build-deps \
25+
autoconf \
26+
automake \
27+
g++ \
28+
json-c-dev \
29+
libtool \
30+
libxml2-dev \
31+
make \
32+
perl \
33+
\
34+
&& apk add --no-cache --virtual .build-deps-testing \
35+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
36+
gdal-dev \
37+
geos-dev \
38+
proj4-dev \
39+
&& cd /usr/src/postgis \
40+
&& ./autogen.sh \
41+
# configure options taken from:
42+
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
43+
&& ./configure \
44+
# --with-gui \
45+
&& make \
46+
&& make install \
47+
&& apk add --no-cache --virtual .postgis-rundeps \
48+
json-c \
49+
&& apk add --no-cache --virtual .postgis-rundeps-testing \
50+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
51+
geos \
52+
gdal \
53+
proj4 \
54+
&& cd / \
55+
&& rm -rf /usr/src/postgis \
56+
&& apk del .fetch-deps .build-deps .build-deps-testing
57+
58+
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh

9.4-2.3/alpine/initdb-postgis.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Perform all actions as $POSTGRES_USER
6+
export PGUSER="$POSTGRES_USER"
7+
8+
# Create the 'template_postgis' template db
9+
"${psql[@]}" <<- 'EOSQL'
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
12+
EOSQL
13+
14+
# Load PostGIS into both template_database and $POSTGRES_DB
15+
for DB in template_postgis "$POSTGRES_DB"; do
16+
echo "Loading PostGIS extensions into $DB"
17+
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
18+
CREATE EXTENSION IF NOT EXISTS postgis;
19+
CREATE EXTENSION IF NOT EXISTS postgis_topology;
20+
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
21+
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
22+
EOSQL
23+
done

9.5-2.3/alpine/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM postgres:9.5-alpine
2+
MAINTAINER Régis Belson <[email protected]>
3+
4+
ENV POSTGIS_VERSION 2.3.1
5+
ENV POSTGIS_SHA256 0f1e0fe08f55b6db791d8600bb343e4f77590725acbbec99094a30b8b7439cd8
6+
7+
RUN set -ex \
8+
\
9+
&& apk add --no-cache --virtual .fetch-deps \
10+
ca-certificates \
11+
openssl \
12+
tar \
13+
\
14+
&& wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
15+
&& echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
16+
&& mkdir -p /usr/src/postgis \
17+
&& tar \
18+
--extract \
19+
--file postgis.tar.gz \
20+
--directory /usr/src/postgis \
21+
--strip-components 1 \
22+
&& rm postgis.tar.gz \
23+
\
24+
&& apk add --no-cache --virtual .build-deps \
25+
autoconf \
26+
automake \
27+
g++ \
28+
json-c-dev \
29+
libtool \
30+
libxml2-dev \
31+
make \
32+
perl \
33+
\
34+
&& apk add --no-cache --virtual .build-deps-testing \
35+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
36+
gdal-dev \
37+
geos-dev \
38+
proj4-dev \
39+
&& cd /usr/src/postgis \
40+
&& ./autogen.sh \
41+
# configure options taken from:
42+
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
43+
&& ./configure \
44+
# --with-gui \
45+
&& make \
46+
&& make install \
47+
&& apk add --no-cache --virtual .postgis-rundeps \
48+
json-c \
49+
&& apk add --no-cache --virtual .postgis-rundeps-testing \
50+
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
51+
geos \
52+
gdal \
53+
proj4 \
54+
&& cd / \
55+
&& rm -rf /usr/src/postgis \
56+
&& apk del .fetch-deps .build-deps .build-deps-testing
57+
58+
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh

9.5-2.3/alpine/initdb-postgis.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Perform all actions as $POSTGRES_USER
6+
export PGUSER="$POSTGRES_USER"
7+
8+
# Create the 'template_postgis' template db
9+
"${psql[@]}" <<- 'EOSQL'
10+
CREATE DATABASE template_postgis;
11+
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
12+
EOSQL
13+
14+
# Load PostGIS into both template_database and $POSTGRES_DB
15+
for DB in template_postgis "$POSTGRES_DB"; do
16+
echo "Loading PostGIS extensions into $DB"
17+
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
18+
CREATE EXTENSION IF NOT EXISTS postgis;
19+
CREATE EXTENSION IF NOT EXISTS postgis_topology;
20+
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
21+
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
22+
EOSQL
23+
done

0 commit comments

Comments
 (0)