diff --git a/.travis.yml b/.travis.yml index 87b8b6c2..f228bbfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,18 @@ services: docker dist: trusty env: - - 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.6-3 + - VERSION=9.6-3 VARIANT=alpine + - VERSION=9.5-3 + - VERSION=9.5-3 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 + - VERSION=12-3 + - VERSION=12-3 VARIANT=alpine + - VERSION=11-3 + - VERSION=11-3 VARIANT=alpine + - VERSION=10-3 + - VERSION=10-3 VARIANT=alpine install: - git clone https://github.com/docker-library/official-images.git ~/official-images @@ -25,5 +27,5 @@ before_script: - image="appropriate/postgis:$VERSION${VARIANT:+-${VARIANT}}" script: - - docker build --pull -t "$image" . + - travis_retry docker build --pull -t "$image" . - ~/official-images/test/run.sh -c ~/official-images/test/config.sh -c "../${VARIANT:+../}test/postgis-config.sh" "$image" diff --git a/10-2.5/Dockerfile b/10-3/Dockerfile similarity index 76% rename from 10-2.5/Dockerfile rename to 10-3/Dockerfile index c2b78f53..c070d6fc 100644 --- a/10-2.5/Dockerfile +++ b/10-3/Dockerfile @@ -1,15 +1,14 @@ FROM postgres:10 -MAINTAINER Mike Dillon +LABEL maintainer="Mike Dillon " -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.2+dfsg-1~exp1.pgdg90+1 +ENV POSTGIS_MAJOR 3 +ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg90+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ && apt-get install -y --no-install-recommends \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ - postgis=$POSTGIS_VERSION \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d diff --git a/11-2.5/README.md b/10-3/README.md similarity index 93% rename from 11-2.5/README.md rename to 10-3/README.md index 8a064afb..38f704a3 100644 --- a/11-2.5/README.md +++ b/10-3/README.md @@ -2,7 +2,9 @@ [![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 2.5](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), Postgres 10, and Postgres 11. +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: diff --git a/10-2.5/alpine/Dockerfile b/10-3/alpine/Dockerfile similarity index 66% rename from 10-2.5/alpine/Dockerfile rename to 10-3/alpine/Dockerfile index ada31ce2..630bd9a8 100644 --- a/10-2.5/alpine/Dockerfile +++ b/10-3/alpine/Dockerfile @@ -1,8 +1,8 @@ FROM postgres:10-alpine -MAINTAINER Régis Belson +LABEL maintainer="Régis Belson " -ENV POSTGIS_VERSION 2.5.2 -ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 +ENV POSTGIS_VERSION 3.0.0 +ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123 RUN set -ex \ \ @@ -24,19 +24,19 @@ RUN set -ex \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ - g++ \ + file \ 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 \ + clang-dev \ + g++ \ + gcc \ gdal-dev \ geos-dev \ - proj4-dev \ + llvm9-dev \ + proj-dev \ protobuf-c-dev \ && cd /usr/src/postgis \ && ./autogen.sh \ @@ -48,16 +48,14 @@ RUN set -ex \ && 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 \ - proj4 \ + proj \ + libstdc++ \ protobuf-c \ && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-edge + && apk del .fetch-deps .build-deps COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh COPY ./update-postgis.sh /usr/local/bin diff --git a/10-2.5/alpine/initdb-postgis.sh b/10-3/alpine/initdb-postgis.sh similarity index 100% rename from 10-2.5/alpine/initdb-postgis.sh rename to 10-3/alpine/initdb-postgis.sh diff --git a/10-2.5/alpine/update-postgis.sh b/10-3/alpine/update-postgis.sh similarity index 100% rename from 10-2.5/alpine/update-postgis.sh rename to 10-3/alpine/update-postgis.sh diff --git a/10-2.5/initdb-postgis.sh b/10-3/initdb-postgis.sh similarity index 100% rename from 10-2.5/initdb-postgis.sh rename to 10-3/initdb-postgis.sh diff --git a/10-2.5/update-postgis.sh b/10-3/update-postgis.sh similarity index 100% rename from 10-2.5/update-postgis.sh rename to 10-3/update-postgis.sh diff --git a/11-2.5/Dockerfile b/11-3/Dockerfile similarity index 76% rename from 11-2.5/Dockerfile rename to 11-3/Dockerfile index 381480ca..6dd1514e 100644 --- a/11-2.5/Dockerfile +++ b/11-3/Dockerfile @@ -1,15 +1,14 @@ FROM postgres:11 -MAINTAINER Mike Dillon +LABEL maintainer="Mike Dillon " -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.2+dfsg-1~exp1.pgdg90+1 +ENV POSTGIS_MAJOR 3 +ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg90+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ && apt-get install -y --no-install-recommends \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ - postgis=$POSTGIS_VERSION \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d diff --git a/10-2.5/README.md b/11-3/README.md similarity index 93% rename from 10-2.5/README.md rename to 11-3/README.md index 8a064afb..38f704a3 100644 --- a/10-2.5/README.md +++ b/11-3/README.md @@ -2,7 +2,9 @@ [![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 2.5](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), Postgres 10, and Postgres 11. +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: diff --git a/11-2.5/alpine/Dockerfile b/11-3/alpine/Dockerfile similarity index 66% rename from 11-2.5/alpine/Dockerfile rename to 11-3/alpine/Dockerfile index 7fec69b5..71cba510 100644 --- a/11-2.5/alpine/Dockerfile +++ b/11-3/alpine/Dockerfile @@ -1,8 +1,8 @@ FROM postgres:11-alpine -MAINTAINER Régis Belson +LABEL maintainer="Régis Belson " -ENV POSTGIS_VERSION 2.5.2 -ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 +ENV POSTGIS_VERSION 3.0.0 +ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123 RUN set -ex \ \ @@ -24,19 +24,19 @@ RUN set -ex \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ - g++ \ + file \ 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 \ + clang-dev \ + g++ \ + gcc \ gdal-dev \ geos-dev \ - proj4-dev \ + llvm9-dev \ + proj-dev \ protobuf-c-dev \ && cd /usr/src/postgis \ && ./autogen.sh \ @@ -48,16 +48,14 @@ RUN set -ex \ && 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 \ - proj4 \ + proj \ + libstdc++ \ protobuf-c \ && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-edge + && apk del .fetch-deps .build-deps COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh COPY ./update-postgis.sh /usr/local/bin diff --git a/11-2.5/alpine/initdb-postgis.sh b/11-3/alpine/initdb-postgis.sh similarity index 100% rename from 11-2.5/alpine/initdb-postgis.sh rename to 11-3/alpine/initdb-postgis.sh diff --git a/11-2.5/alpine/update-postgis.sh b/11-3/alpine/update-postgis.sh similarity index 100% rename from 11-2.5/alpine/update-postgis.sh rename to 11-3/alpine/update-postgis.sh diff --git a/11-2.5/initdb-postgis.sh b/11-3/initdb-postgis.sh similarity index 100% rename from 11-2.5/initdb-postgis.sh rename to 11-3/initdb-postgis.sh diff --git a/11-2.5/update-postgis.sh b/11-3/update-postgis.sh similarity index 100% rename from 11-2.5/update-postgis.sh rename to 11-3/update-postgis.sh diff --git a/12-3/Dockerfile b/12-3/Dockerfile new file mode 100644 index 00000000..fe50a591 --- /dev/null +++ b/12-3/Dockerfile @@ -0,0 +1,17 @@ +FROM postgres:12 +LABEL maintainer="Mike Dillon " + +ENV POSTGIS_MAJOR 3 +ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg100+1 + +RUN apt-get update \ + && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ + && apt-get install -y --no-install-recommends \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ + postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /docker-entrypoint-initdb.d +COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh +COPY ./update-postgis.sh /usr/local/bin + diff --git a/9.5-2.5/README.md b/12-3/README.md similarity index 93% rename from 9.5-2.5/README.md rename to 12-3/README.md index 8a064afb..38f704a3 100644 --- a/9.5-2.5/README.md +++ b/12-3/README.md @@ -2,7 +2,9 @@ [![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 2.5](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), Postgres 10, and Postgres 11. +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: diff --git a/12-3/alpine/Dockerfile b/12-3/alpine/Dockerfile new file mode 100644 index 00000000..a378bc80 --- /dev/null +++ b/12-3/alpine/Dockerfile @@ -0,0 +1,61 @@ +FROM postgres:12-alpine +LABEL maintainer="Régis Belson " + +ENV POSTGIS_VERSION 3.0.0 +ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123 + +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 \ + file \ + json-c-dev \ + libtool \ + libxml2-dev \ + make \ + perl \ + clang-dev \ + g++ \ + gcc \ + gdal-dev \ + geos-dev \ + llvm9-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 \ + geos \ + gdal \ + proj \ + libstdc++ \ + protobuf-c \ + && cd / \ + && rm -rf /usr/src/postgis \ + && apk del .fetch-deps .build-deps + +COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh +COPY ./update-postgis.sh /usr/local/bin diff --git a/9.5-2.5/alpine/initdb-postgis.sh b/12-3/alpine/initdb-postgis.sh similarity index 100% rename from 9.5-2.5/alpine/initdb-postgis.sh rename to 12-3/alpine/initdb-postgis.sh diff --git a/9.5-2.5/alpine/update-postgis.sh b/12-3/alpine/update-postgis.sh old mode 100755 new mode 100644 similarity index 100% rename from 9.5-2.5/alpine/update-postgis.sh rename to 12-3/alpine/update-postgis.sh diff --git a/9.5-2.5/initdb-postgis.sh b/12-3/initdb-postgis.sh similarity index 100% rename from 9.5-2.5/initdb-postgis.sh rename to 12-3/initdb-postgis.sh diff --git a/9.5-2.5/update-postgis.sh b/12-3/update-postgis.sh similarity index 100% rename from 9.5-2.5/update-postgis.sh rename to 12-3/update-postgis.sh diff --git a/9.4-2.5/Dockerfile b/9.4-2.5/Dockerfile index 2ee20ffe..237fab6f 100644 --- a/9.4-2.5/Dockerfile +++ b/9.4-2.5/Dockerfile @@ -1,15 +1,14 @@ FROM postgres:9.4 -MAINTAINER Mike Dillon +LABEL maintainer="Mike Dillon " ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.2+dfsg-1~exp1.pgdg90+1 +ENV POSTGIS_VERSION 2.5.3+dfsg-3.pgdg90+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ && apt-get install -y --no-install-recommends \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ - postgis=$POSTGIS_VERSION \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d diff --git a/9.4-2.5/README.md b/9.4-2.5/README.md index 8a064afb..38f704a3 100644 --- a/9.4-2.5/README.md +++ b/9.4-2.5/README.md @@ -2,7 +2,9 @@ [![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 2.5](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), Postgres 10, and Postgres 11. +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: diff --git a/9.4-2.5/alpine/Dockerfile b/9.4-2.5/alpine/Dockerfile index 44f2b42d..d946df50 100644 --- a/9.4-2.5/alpine/Dockerfile +++ b/9.4-2.5/alpine/Dockerfile @@ -1,8 +1,8 @@ FROM postgres:9.4-alpine -MAINTAINER Régis Belson +LABEL maintainer="Régis Belson " -ENV POSTGIS_VERSION 2.5.2 -ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 +ENV POSTGIS_VERSION 2.5.3 +ENV POSTGIS_SHA256 402323c83d97f3859bc9083345dd687f933c261efe0830e1262c20c12671f794 RUN set -ex \ \ @@ -24,19 +24,19 @@ RUN set -ex \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ - g++ \ + file \ 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 \ + clang-dev \ + g++ \ + gcc \ gdal-dev \ geos-dev \ - proj4-dev \ + llvm9-dev \ + proj-dev \ protobuf-c-dev \ && cd /usr/src/postgis \ && ./autogen.sh \ @@ -48,16 +48,14 @@ RUN set -ex \ && 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 \ - proj4 \ + proj \ + libstdc++ \ protobuf-c \ && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-edge + && apk del .fetch-deps .build-deps COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh COPY ./update-postgis.sh /usr/local/bin diff --git a/9.5-2.5/Dockerfile b/9.5-3/Dockerfile similarity index 76% rename from 9.5-2.5/Dockerfile rename to 9.5-3/Dockerfile index 4e107f35..c9f595b5 100644 --- a/9.5-2.5/Dockerfile +++ b/9.5-3/Dockerfile @@ -1,15 +1,14 @@ FROM postgres:9.5 -MAINTAINER Mike Dillon +LABEL maintainer="Mike Dillon " -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.2+dfsg-1~exp1.pgdg90+1 +ENV POSTGIS_MAJOR 3 +ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg90+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ && apt-get install -y --no-install-recommends \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ - postgis=$POSTGIS_VERSION \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d diff --git a/9.6-2.5/README.md b/9.5-3/README.md similarity index 93% rename from 9.6-2.5/README.md rename to 9.5-3/README.md index 8a064afb..38f704a3 100644 --- a/9.6-2.5/README.md +++ b/9.5-3/README.md @@ -2,7 +2,9 @@ [![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 2.5](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), Postgres 10, and Postgres 11. +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: diff --git a/9.5-2.5/alpine/Dockerfile b/9.5-3/alpine/Dockerfile similarity index 66% rename from 9.5-2.5/alpine/Dockerfile rename to 9.5-3/alpine/Dockerfile index 21bf5184..1fd781e8 100644 --- a/9.5-2.5/alpine/Dockerfile +++ b/9.5-3/alpine/Dockerfile @@ -1,8 +1,8 @@ FROM postgres:9.5-alpine -MAINTAINER Régis Belson +LABEL maintainer="Régis Belson " -ENV POSTGIS_VERSION 2.5.2 -ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 +ENV POSTGIS_VERSION 3.0.0 +ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123 RUN set -ex \ \ @@ -24,19 +24,19 @@ RUN set -ex \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ - g++ \ + file \ 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 \ + clang-dev \ + g++ \ + gcc \ gdal-dev \ geos-dev \ - proj4-dev \ + llvm9-dev \ + proj-dev \ protobuf-c-dev \ && cd /usr/src/postgis \ && ./autogen.sh \ @@ -48,16 +48,14 @@ RUN set -ex \ && 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 \ - proj4 \ + proj \ + libstdc++ \ protobuf-c \ && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-edge + && apk del .fetch-deps .build-deps COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh COPY ./update-postgis.sh /usr/local/bin diff --git a/9.6-2.5/alpine/initdb-postgis.sh b/9.5-3/alpine/initdb-postgis.sh similarity index 100% rename from 9.6-2.5/alpine/initdb-postgis.sh rename to 9.5-3/alpine/initdb-postgis.sh diff --git a/9.6-2.5/alpine/update-postgis.sh b/9.5-3/alpine/update-postgis.sh similarity index 100% rename from 9.6-2.5/alpine/update-postgis.sh rename to 9.5-3/alpine/update-postgis.sh diff --git a/9.6-2.5/initdb-postgis.sh b/9.5-3/initdb-postgis.sh similarity index 100% rename from 9.6-2.5/initdb-postgis.sh rename to 9.5-3/initdb-postgis.sh diff --git a/9.6-2.5/update-postgis.sh b/9.5-3/update-postgis.sh similarity index 100% rename from 9.6-2.5/update-postgis.sh rename to 9.5-3/update-postgis.sh diff --git a/9.6-2.5/Dockerfile b/9.6-3/Dockerfile similarity index 76% rename from 9.6-2.5/Dockerfile rename to 9.6-3/Dockerfile index 9bdcbd6b..c6836b29 100644 --- a/9.6-2.5/Dockerfile +++ b/9.6-3/Dockerfile @@ -1,15 +1,14 @@ FROM postgres:9.6 -MAINTAINER Mike Dillon +LABEL maintainer="Mike Dillon " -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.2+dfsg-1~exp1.pgdg90+1 +ENV POSTGIS_MAJOR 3 +ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg90+1 RUN apt-get update \ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \ && apt-get install -y --no-install-recommends \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ - postgis=$POSTGIS_VERSION \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d diff --git a/9.6-3/README.md b/9.6-3/README.md new file mode 100644 index 00000000..38f704a3 --- /dev/null +++ b/9.6-3/README.md @@ -0,0 +1,53 @@ +# mdillon/postgis + +[![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. + +This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: + +* `postgis` +* `postgis_topology` +* `fuzzystrmatch` +* `postgis_tiger_geocoder` + +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`. + +## Usage + +In order to run a basic container capable of serving a PostGIS-enabled database, start a container as follows: + + docker run --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -d mdillon/postgis + +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/). + +Once you have started a database container, you can then connect to the database as follows: + + docker run -it --link some-postgis:postgres --rm postgres \ + sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres' + +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. + +## Known Issues / Errors + +When You encouter errors due to PostGIS update `OperationalError: could not access file "$libdir/postgis-X.X`, run: + +`docker exec some-postgis update-postgis.sh` + +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: + +``` +Updating PostGIS extensions template_postgis to X.X.X +NOTICE: version "X.X.X" of extension "postgis" is already installed +NOTICE: version "X.X.X" of extension "postgis_topology" is already installed +NOTICE: version "X.X.X" of extension "postgis_tiger_geocoder" is already installed +ALTER EXTENSION +Updating PostGIS extensions docker to X.X.X +NOTICE: version "X.X.X" of extension "postgis" is already installed +NOTICE: version "X.X.X" of extension "postgis_topology" is already installed +NOTICE: version "X.X.X" of extension "postgis_tiger_geocoder" is already installed +ALTER EXTENSION +``` + diff --git a/9.6-2.5/alpine/Dockerfile b/9.6-3/alpine/Dockerfile similarity index 66% rename from 9.6-2.5/alpine/Dockerfile rename to 9.6-3/alpine/Dockerfile index fda65829..2fa8d8d1 100644 --- a/9.6-2.5/alpine/Dockerfile +++ b/9.6-3/alpine/Dockerfile @@ -1,8 +1,8 @@ FROM postgres:9.6-alpine -MAINTAINER Régis Belson +LABEL maintainer="Régis Belson " -ENV POSTGIS_VERSION 2.5.2 -ENV POSTGIS_SHA256 225aeaece00a1a6a9af15526af81bef2af27f4c198de820af1367a792ee1d1a9 +ENV POSTGIS_VERSION 3.0.0 +ENV POSTGIS_SHA256 1c83fb2fc8870d36ed49859c49a12c8c4c8ae8c5c3f912a21a951c5bcc249123 RUN set -ex \ \ @@ -24,19 +24,19 @@ RUN set -ex \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ - g++ \ + file \ 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 \ + clang-dev \ + g++ \ + gcc \ gdal-dev \ geos-dev \ - proj4-dev \ + llvm9-dev \ + proj-dev \ protobuf-c-dev \ && cd /usr/src/postgis \ && ./autogen.sh \ @@ -48,16 +48,14 @@ RUN set -ex \ && 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 \ - proj4 \ + proj \ + libstdc++ \ protobuf-c \ && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-edge + && apk del .fetch-deps .build-deps COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh COPY ./update-postgis.sh /usr/local/bin diff --git a/9.6-3/alpine/initdb-postgis.sh b/9.6-3/alpine/initdb-postgis.sh new file mode 100644 index 00000000..43012885 --- /dev/null +++ b/9.6-3/alpine/initdb-postgis.sh @@ -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 diff --git a/9.6-3/alpine/update-postgis.sh b/9.6-3/alpine/update-postgis.sh new file mode 100755 index 00000000..f98abd26 --- /dev/null +++ b/9.6-3/alpine/update-postgis.sh @@ -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 diff --git a/9.6-3/initdb-postgis.sh b/9.6-3/initdb-postgis.sh new file mode 100644 index 00000000..43012885 --- /dev/null +++ b/9.6-3/initdb-postgis.sh @@ -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 diff --git a/9.6-3/update-postgis.sh b/9.6-3/update-postgis.sh new file mode 100755 index 00000000..f98abd26 --- /dev/null +++ b/9.6-3/update-postgis.sh @@ -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 diff --git a/Dockerfile.alpine.template b/Dockerfile.alpine.template index d3e5f34f..bcd3cf3f 100644 --- a/Dockerfile.alpine.template +++ b/Dockerfile.alpine.template @@ -1,5 +1,5 @@ FROM postgres:%%PG_MAJOR%%-alpine -MAINTAINER Régis Belson +LABEL maintainer="Régis Belson " ENV POSTGIS_VERSION %%POSTGIS_VERSION%% ENV POSTGIS_SHA256 %%POSTGIS_SHA256%% @@ -24,19 +24,19 @@ RUN set -ex \ && apk add --no-cache --virtual .build-deps \ autoconf \ automake \ - g++ \ + file \ 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 \ + clang-dev \ + g++ \ + gcc \ gdal-dev \ geos-dev \ - proj4-dev \ + llvm9-dev \ + proj-dev \ protobuf-c-dev \ && cd /usr/src/postgis \ && ./autogen.sh \ @@ -48,16 +48,14 @@ RUN set -ex \ && 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 \ - proj4 \ + proj \ + libstdc++ \ protobuf-c \ && cd / \ && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-edge + && apk del .fetch-deps .build-deps COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh COPY ./update-postgis.sh /usr/local/bin diff --git a/Dockerfile.template b/Dockerfile.template index 8f8b6191..2b06a75e 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -1,5 +1,5 @@ FROM postgres:%%PG_MAJOR%% -MAINTAINER Mike Dillon +LABEL maintainer="Mike Dillon " ENV POSTGIS_MAJOR %%POSTGIS_MAJOR%% ENV POSTGIS_VERSION %%POSTGIS_VERSION%% @@ -9,7 +9,6 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \ - postgis=$POSTGIS_VERSION \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /docker-entrypoint-initdb.d diff --git a/README.md b/README.md index 8a064afb..38f704a3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ [![Build Status](https://travis-ci.org/appropriate/docker-postgis.svg)](https://travis-ci.org/appropriate/docker-postgis) [![Join the chat at https://gitter.im/appropriate/docker-postgis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/appropriate/docker-postgis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 2.5](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), Postgres 10, and Postgres 11. +The `mdillon/postgis` image provides a Docker container running Postgres with [PostGIS 3.0](http://postgis.net/) installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides variants for each version of Postgres 9 supported by the base image (9.4-9.6), and Postgres 10-12. + +Note that Postgres 9.4 image runs with PostGIS 2.5. This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: diff --git a/update.sh b/update.sh index 42a16481..7b7296da 100755 --- a/update.sh +++ b/update.sh @@ -10,19 +10,19 @@ if [ ${#versions[@]} -eq 0 ]; then fi versions=( "${versions[@]%/Dockerfile}" ) -packagesUrlJessie='http://apt.postgresql.org/pub/repos/apt/dists/jessie-pgdg/main/binary-amd64/Packages' -packagesJessie="$(echo "$packagesUrlJessie" | sed -r 's/[^a-zA-Z.-]+/-/g')" -curl -sSL "${packagesUrlJessie}.bz2" | bunzip2 > "$packagesJessie" - packagesUrlStretch='http://apt.postgresql.org/pub/repos/apt/dists/stretch-pgdg/main/binary-amd64/Packages' packagesStretch="$(echo "$packagesUrlStretch" | sed -r 's/[^a-zA-Z.-]+/-/g')" curl -sSL "${packagesUrlStretch}.bz2" | bunzip2 > "$packagesStretch" +packagesUrlBuster='http://apt.postgresql.org/pub/repos/apt/dists/buster-pgdg/main/binary-amd64/Packages' +packagesBuster="$(echo "$packagesUrlBuster" | sed -r 's/[^a-zA-Z.-]+/-/g')" +curl -sSL "${packagesUrlBuster}.bz2" | bunzip2 > "$packagesBuster" + travisEnv= for version in "${versions[@]}"; do IFS=- read pg_major postgis_major <<< "$version" - if [[ $pg_major = 9* ]]; then - packages="$packagesStretch" + if [[ $pg_major = 12 ]]; then + packages="$packagesBuster" else packages="$packagesStretch" fi @@ -56,5 +56,5 @@ done travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" echo "$travis" > .travis.yml -rm "$packagesJessie" rm "$packagesStretch" +rm "$packagesBuster"