Skip to content

Commit fef33dc

Browse files
committed
add regression test ; add 13-3.0
1 parent b985210 commit fef33dc

File tree

23 files changed

+417
-6
lines changed

23 files changed

+417
-6
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ dist: xenial
66

77
env:
88
- VERSION=13-master
9+
- VERSION=13-3.0
10+
- VERSION=13-3.0 VARIANT=alpine
911
- VERSION=12-master
1012
- VERSION=12-3.0
1113
- VERSION=12-3.0 VARIANT=alpine

10-2.5/alpine/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,25 @@ RUN set -ex \
4747
# --with-gui \
4848
&& make -j$(nproc) \
4949
&& make install \
50+
# regress check
51+
&& mkdir /tempdb \
52+
&& chown -R postgres:postgres /tempdb \
53+
&& su postgres -c 'pg_ctl -D /tempdb init' \
54+
&& su postgres -c 'pg_ctl -D /tempdb start' \
55+
&& cd regress \
56+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
57+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
58+
&& rm -rf /tempdb \
59+
&& rm -rf /tmp/pgis_reg \
60+
# add .postgis-rundeps
5061
&& apk add --no-cache --virtual .postgis-rundeps \
5162
json-c \
5263
geos \
5364
gdal \
5465
proj \
5566
libstdc++ \
5667
protobuf-c \
68+
# clean
5769
&& cd / \
5870
&& rm -rf /usr/src/postgis \
5971
&& apk del .fetch-deps .build-deps

10-3.0/alpine/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,25 @@ RUN set -ex \
4747
# --with-gui \
4848
&& make -j$(nproc) \
4949
&& make install \
50+
# regress check
51+
&& mkdir /tempdb \
52+
&& chown -R postgres:postgres /tempdb \
53+
&& su postgres -c 'pg_ctl -D /tempdb init' \
54+
&& su postgres -c 'pg_ctl -D /tempdb start' \
55+
&& cd regress \
56+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
57+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
58+
&& rm -rf /tempdb \
59+
&& rm -rf /tmp/pgis_reg \
60+
# add .postgis-rundeps
5061
&& apk add --no-cache --virtual .postgis-rundeps \
5162
json-c \
5263
geos \
5364
gdal \
5465
proj \
5566
libstdc++ \
5667
protobuf-c \
68+
# clean
5769
&& cd / \
5870
&& rm -rf /usr/src/postgis \
5971
&& apk del .fetch-deps .build-deps

11-2.5/alpine/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,25 @@ RUN set -ex \
4747
# --with-gui \
4848
&& make -j$(nproc) \
4949
&& make install \
50+
# regress check
51+
&& mkdir /tempdb \
52+
&& chown -R postgres:postgres /tempdb \
53+
&& su postgres -c 'pg_ctl -D /tempdb init' \
54+
&& su postgres -c 'pg_ctl -D /tempdb start' \
55+
&& cd regress \
56+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
57+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
58+
&& rm -rf /tempdb \
59+
&& rm -rf /tmp/pgis_reg \
60+
# add .postgis-rundeps
5061
&& apk add --no-cache --virtual .postgis-rundeps \
5162
json-c \
5263
geos \
5364
gdal \
5465
proj \
5566
libstdc++ \
5667
protobuf-c \
68+
# clean
5769
&& cd / \
5870
&& rm -rf /usr/src/postgis \
5971
&& apk del .fetch-deps .build-deps

11-3.0/alpine/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,25 @@ RUN set -ex \
4747
# --with-gui \
4848
&& make -j$(nproc) \
4949
&& make install \
50+
# regress check
51+
&& mkdir /tempdb \
52+
&& chown -R postgres:postgres /tempdb \
53+
&& su postgres -c 'pg_ctl -D /tempdb init' \
54+
&& su postgres -c 'pg_ctl -D /tempdb start' \
55+
&& cd regress \
56+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
57+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
58+
&& rm -rf /tempdb \
59+
&& rm -rf /tmp/pgis_reg \
60+
# add .postgis-rundeps
5061
&& apk add --no-cache --virtual .postgis-rundeps \
5162
json-c \
5263
geos \
5364
gdal \
5465
proj \
5566
libstdc++ \
5667
protobuf-c \
68+
# clean
5769
&& cd / \
5870
&& rm -rf /usr/src/postgis \
5971
&& apk del .fetch-deps .build-deps

12-2.5/alpine/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,25 @@ RUN set -ex \
4747
# --with-gui \
4848
&& make -j$(nproc) \
4949
&& make install \
50+
# regress check
51+
&& mkdir /tempdb \
52+
&& chown -R postgres:postgres /tempdb \
53+
&& su postgres -c 'pg_ctl -D /tempdb init' \
54+
&& su postgres -c 'pg_ctl -D /tempdb start' \
55+
&& cd regress \
56+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
57+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
58+
&& rm -rf /tempdb \
59+
&& rm -rf /tmp/pgis_reg \
60+
# add .postgis-rundeps
5061
&& apk add --no-cache --virtual .postgis-rundeps \
5162
json-c \
5263
geos \
5364
gdal \
5465
proj \
5566
libstdc++ \
5667
protobuf-c \
68+
# clean
5769
&& cd / \
5870
&& rm -rf /usr/src/postgis \
5971
&& apk del .fetch-deps .build-deps

12-3.0/alpine/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,25 @@ RUN set -ex \
4747
# --with-gui \
4848
&& make -j$(nproc) \
4949
&& make install \
50+
# regress check
51+
&& mkdir /tempdb \
52+
&& chown -R postgres:postgres /tempdb \
53+
&& su postgres -c 'pg_ctl -D /tempdb init' \
54+
&& su postgres -c 'pg_ctl -D /tempdb start' \
55+
&& cd regress \
56+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
57+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
58+
&& rm -rf /tempdb \
59+
&& rm -rf /tmp/pgis_reg \
60+
# add .postgis-rundeps
5061
&& apk add --no-cache --virtual .postgis-rundeps \
5162
json-c \
5263
geos \
5364
gdal \
5465
proj \
5566
libstdc++ \
5667
protobuf-c \
68+
# clean
5769
&& cd / \
5870
&& rm -rf /usr/src/postgis \
5971
&& apk del .fetch-deps .build-deps

12-master/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ENV SFCGAL_GIT_HASH d2c4d5b4899620e5dbab94410403af41829d6239
77
ENV PROJ_VERSION master
88
ENV PROJ_GIT_HASH 062c7f160f4b1d41f82730fa6eb6653e78ade74a
99
ENV GDAL_VERSION master
10-
ENV GDAL_GIT_HASH aa6afd5454bd8f755d25ae8d10ceb3f659fdb785
10+
ENV GDAL_GIT_HASH 05859865e10c16d78bf84bc8af3d3c004dac49b4
1111
ENV GEOS_VERSION master
1212
ENV GEOS_GIT_HASH 0f938979b58f9a451670032a7199ece23d52c3c1
1313
ENV POSTGIS_VERSION master
@@ -132,6 +132,18 @@ RUN set -ex \
132132
# --with-gui \
133133
&& make -j$(nproc) \
134134
&& make install \
135+
# regress check
136+
&& mkdir /tempdb \
137+
&& chown -R postgres:postgres /tempdb \
138+
&& su postgres -c 'pg_ctl -D /tempdb init' \
139+
&& su postgres -c 'pg_ctl -D /tempdb start' \
140+
&& ldconfig \
141+
&& cd regress \
142+
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
143+
&& su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \
144+
&& rm -rf /tempdb \
145+
&& rm -rf /tmp/pgis_reg \
146+
# clean
135147
&& cd / \
136148
&& rm -rf /usr/src/postgis \
137149
&& apt-get purge -y --autoremove \

13-3.0/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM postgres:13
2+
3+
LABEL maintainer="PostGIS Project - https://postgis.net"
4+
5+
ENV POSTGIS_MAJOR 3
6+
ENV POSTGIS_VERSION 3.0.1+dfsg-4.pgdg100+1
7+
8+
RUN apt-get update \
9+
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
10+
&& apt-get install -y --no-install-recommends \
11+
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
12+
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
RUN mkdir -p /docker-entrypoint-initdb.d
16+
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
17+
COPY ./update-postgis.sh /usr/local/bin
18+

13-3.0/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# postgis/postgis
2+
3+
[![Build Status](https://travis-ci.org/postgis/docker-postgis.svg)](https://travis-ci.org/postgis/docker-postgis) [![Join the chat at https://gitter.im/postgis/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/postgis/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
5+
The `postgis/postgis` image provides tags for running Postgres with [PostGIS](http://postgis.net/) extensions installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides debian and alpine variants for PostGIS both 2.5.x and 3.0.x for each supported version of Postgres (9.5, 9.6, 10, 11, and 12). Additionally, an image version is provided which is built from the latest version of Postgres (12) with versions of PostGIS and its dependencies built from their respective master branches.
6+
7+
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:
8+
9+
* `postgis`
10+
* `postgis_topology`
11+
* `fuzzystrmatch`
12+
* `postgis_tiger_geocoder`
13+
14+
Unless `-e POSTGRES_DB` is passed to the container at startup time, this database will be named after the admin user (either `postgres` or the user specified with `-e POSTGRES_USER`). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called `template_postgis`.
15+
16+
## Usage
17+
18+
In order to run a basic container capable of serving a PostGIS-enabled database, start a container as follows:
19+
20+
docker run --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis
21+
22+
For more detailed instructions about how to start and control your Postgres container, see the documentation for the `postgres` image [here](https://registry.hub.docker.com/_/postgres/).
23+
24+
Once you have started a database container, you can then connect to the database as follows:
25+
26+
docker run -it --link some-postgis:postgres --rm postgres \
27+
sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
28+
29+
See [the PostGIS documentation](http://postgis.net/docs/postgis_installation.html#create_new_db_extensions) for more details on your options for creating and using a spatially-enabled database.
30+
31+
## Known Issues / Errors
32+
33+
When You encouter errors due to PostGIS update `OperationalError: could not access file "$libdir/postgis-X.X`, run:
34+
35+
`docker exec some-postgis update-postgis.sh`
36+
37+
It will update to Your newest PostGIS. Update is idempotent, so it won't hurt when You run it more than once, You will get notification like:
38+
39+
```
40+
Updating PostGIS extensions template_postgis to X.X.X
41+
NOTICE: version "X.X.X" of extension "postgis" is already installed
42+
NOTICE: version "X.X.X" of extension "postgis_topology" is already installed
43+
NOTICE: version "X.X.X" of extension "postgis_tiger_geocoder" is already installed
44+
ALTER EXTENSION
45+
Updating PostGIS extensions docker to X.X.X
46+
NOTICE: version "X.X.X" of extension "postgis" is already installed
47+
NOTICE: version "X.X.X" of extension "postgis_topology" is already installed
48+
NOTICE: version "X.X.X" of extension "postgis_tiger_geocoder" is already installed
49+
ALTER EXTENSION
50+
```
51+

0 commit comments

Comments
 (0)