From 927c4f0521654f9fade015b8648c7e32860e1b16 Mon Sep 17 00:00:00 2001 From: Flavien Raynaud Date: Thu, 15 Jul 2021 14:20:46 +1000 Subject: [PATCH] Keep only postgis 9.6 alpine docker build does not seem to like finding Dockerfiles in sub-directories. https://github.com/moby/buildkit/issues/1684 --- 10-2.5/Dockerfile | 18 -- 10-2.5/README.md | 63 ----- 10-2.5/alpine/Dockerfile | 110 -------- 10-2.5/alpine/initdb-postgis.sh | 22 -- 10-2.5/alpine/update-postgis.sh | 28 -- 10-2.5/initdb-postgis.sh | 22 -- 10-2.5/update-postgis.sh | 28 -- 10-3.1/Dockerfile | 18 -- 10-3.1/README.md | 63 ----- 10-3.1/alpine/Dockerfile | 110 -------- 10-3.1/alpine/initdb-postgis.sh | 22 -- 10-3.1/alpine/update-postgis.sh | 28 -- 10-3.1/initdb-postgis.sh | 22 -- 10-3.1/update-postgis.sh | 28 -- 11-2.5/Dockerfile | 18 -- 11-2.5/README.md | 63 ----- 11-2.5/alpine/Dockerfile | 110 -------- 11-2.5/alpine/initdb-postgis.sh | 22 -- 11-2.5/alpine/update-postgis.sh | 28 -- 11-2.5/initdb-postgis.sh | 22 -- 11-2.5/update-postgis.sh | 28 -- 11-3.1/Dockerfile | 18 -- 11-3.1/README.md | 63 ----- 11-3.1/alpine/Dockerfile | 110 -------- 11-3.1/alpine/initdb-postgis.sh | 22 -- 11-3.1/alpine/update-postgis.sh | 28 -- 11-3.1/initdb-postgis.sh | 22 -- 11-3.1/update-postgis.sh | 28 -- 12-2.5/Dockerfile | 18 -- 12-2.5/README.md | 63 ----- 12-2.5/alpine/Dockerfile | 110 -------- 12-2.5/alpine/initdb-postgis.sh | 22 -- 12-2.5/alpine/update-postgis.sh | 28 -- 12-2.5/initdb-postgis.sh | 22 -- 12-2.5/update-postgis.sh | 28 -- 12-3.1/Dockerfile | 18 -- 12-3.1/README.md | 63 ----- 12-3.1/alpine/Dockerfile | 110 -------- 12-3.1/alpine/initdb-postgis.sh | 22 -- 12-3.1/alpine/update-postgis.sh | 28 -- 12-3.1/initdb-postgis.sh | 22 -- 12-3.1/update-postgis.sh | 28 -- 12-master/Dockerfile | 282 -------------------- 12-master/README.md | 63 ----- 12-master/initdb-postgis.sh | 22 -- 12-master/update-postgis.sh | 28 -- 13-3.1/Dockerfile | 18 -- 13-3.1/README.md | 63 ----- 13-3.1/alpine/Dockerfile | 110 -------- 13-3.1/alpine/initdb-postgis.sh | 22 -- 13-3.1/alpine/update-postgis.sh | 28 -- 13-3.1/initdb-postgis.sh | 22 -- 13-3.1/update-postgis.sh | 28 -- 13-master/Dockerfile | 282 -------------------- 13-master/README.md | 63 ----- 13-master/initdb-postgis.sh | 22 -- 13-master/update-postgis.sh | 28 -- 14beta2-3.1/Dockerfile | 18 -- 14beta2-3.1/README.md | 63 ----- 14beta2-3.1/alpine/Dockerfile | 110 -------- 14beta2-3.1/alpine/initdb-postgis.sh | 22 -- 14beta2-3.1/alpine/update-postgis.sh | 28 -- 14beta2-3.1/initdb-postgis.sh | 22 -- 14beta2-3.1/update-postgis.sh | 28 -- 9.6-2.5/Dockerfile | 18 -- 9.6-2.5/README.md | 63 ----- 9.6-2.5/alpine/Dockerfile | 110 -------- 9.6-2.5/alpine/initdb-postgis.sh | 22 -- 9.6-2.5/alpine/update-postgis.sh | 28 -- 9.6-2.5/initdb-postgis.sh | 22 -- 9.6-2.5/update-postgis.sh | 28 -- 9.6-3.1/Dockerfile | 18 -- 9.6-3.1/README.md | 63 ----- 9.6-3.1/alpine/initdb-postgis.sh | 22 -- 9.6-3.1/alpine/update-postgis.sh | 28 -- 9.6-3.1/initdb-postgis.sh | 22 -- 9.6-3.1/update-postgis.sh | 28 -- AUTHORS | 3 - 9.6-3.1/alpine/Dockerfile => Dockerfile | 0 Dockerfile.alpine.template | 110 -------- Dockerfile.master.template | 282 -------------------- Dockerfile.template | 18 -- Makefile | 149 ----------- README.md | 63 ----- examples/image-with-postgis-clis/Dockerfile | 6 - examples/image-with-postgis-clis/README.md | 10 - test/postgis-config.sh | 5 - test/tests/postgis-basics/run.sh | 51 ---- update.sh | 116 -------- 89 files changed, 4403 deletions(-) delete mode 100644 10-2.5/Dockerfile delete mode 100644 10-2.5/README.md delete mode 100644 10-2.5/alpine/Dockerfile delete mode 100644 10-2.5/alpine/initdb-postgis.sh delete mode 100755 10-2.5/alpine/update-postgis.sh delete mode 100644 10-2.5/initdb-postgis.sh delete mode 100755 10-2.5/update-postgis.sh delete mode 100644 10-3.1/Dockerfile delete mode 100644 10-3.1/README.md delete mode 100644 10-3.1/alpine/Dockerfile delete mode 100644 10-3.1/alpine/initdb-postgis.sh delete mode 100755 10-3.1/alpine/update-postgis.sh delete mode 100644 10-3.1/initdb-postgis.sh delete mode 100755 10-3.1/update-postgis.sh delete mode 100644 11-2.5/Dockerfile delete mode 100644 11-2.5/README.md delete mode 100644 11-2.5/alpine/Dockerfile delete mode 100644 11-2.5/alpine/initdb-postgis.sh delete mode 100755 11-2.5/alpine/update-postgis.sh delete mode 100644 11-2.5/initdb-postgis.sh delete mode 100755 11-2.5/update-postgis.sh delete mode 100644 11-3.1/Dockerfile delete mode 100644 11-3.1/README.md delete mode 100644 11-3.1/alpine/Dockerfile delete mode 100644 11-3.1/alpine/initdb-postgis.sh delete mode 100755 11-3.1/alpine/update-postgis.sh delete mode 100644 11-3.1/initdb-postgis.sh delete mode 100755 11-3.1/update-postgis.sh delete mode 100644 12-2.5/Dockerfile delete mode 100644 12-2.5/README.md delete mode 100644 12-2.5/alpine/Dockerfile delete mode 100644 12-2.5/alpine/initdb-postgis.sh delete mode 100755 12-2.5/alpine/update-postgis.sh delete mode 100644 12-2.5/initdb-postgis.sh delete mode 100755 12-2.5/update-postgis.sh delete mode 100644 12-3.1/Dockerfile delete mode 100644 12-3.1/README.md delete mode 100644 12-3.1/alpine/Dockerfile delete mode 100644 12-3.1/alpine/initdb-postgis.sh delete mode 100755 12-3.1/alpine/update-postgis.sh delete mode 100644 12-3.1/initdb-postgis.sh delete mode 100755 12-3.1/update-postgis.sh delete mode 100644 12-master/Dockerfile delete mode 100644 12-master/README.md delete mode 100644 12-master/initdb-postgis.sh delete mode 100755 12-master/update-postgis.sh delete mode 100644 13-3.1/Dockerfile delete mode 100644 13-3.1/README.md delete mode 100644 13-3.1/alpine/Dockerfile delete mode 100644 13-3.1/alpine/initdb-postgis.sh delete mode 100755 13-3.1/alpine/update-postgis.sh delete mode 100644 13-3.1/initdb-postgis.sh delete mode 100755 13-3.1/update-postgis.sh delete mode 100644 13-master/Dockerfile delete mode 100644 13-master/README.md delete mode 100644 13-master/initdb-postgis.sh delete mode 100755 13-master/update-postgis.sh delete mode 100644 14beta2-3.1/Dockerfile delete mode 100644 14beta2-3.1/README.md delete mode 100644 14beta2-3.1/alpine/Dockerfile delete mode 100644 14beta2-3.1/alpine/initdb-postgis.sh delete mode 100755 14beta2-3.1/alpine/update-postgis.sh delete mode 100644 14beta2-3.1/initdb-postgis.sh delete mode 100755 14beta2-3.1/update-postgis.sh delete mode 100644 9.6-2.5/Dockerfile delete mode 100644 9.6-2.5/README.md delete mode 100644 9.6-2.5/alpine/Dockerfile delete mode 100644 9.6-2.5/alpine/initdb-postgis.sh delete mode 100755 9.6-2.5/alpine/update-postgis.sh delete mode 100644 9.6-2.5/initdb-postgis.sh delete mode 100755 9.6-2.5/update-postgis.sh delete mode 100644 9.6-3.1/Dockerfile delete mode 100644 9.6-3.1/README.md delete mode 100644 9.6-3.1/alpine/initdb-postgis.sh delete mode 100755 9.6-3.1/alpine/update-postgis.sh delete mode 100644 9.6-3.1/initdb-postgis.sh delete mode 100755 9.6-3.1/update-postgis.sh delete mode 100644 AUTHORS rename 9.6-3.1/alpine/Dockerfile => Dockerfile (100%) delete mode 100644 Dockerfile.alpine.template delete mode 100644 Dockerfile.master.template delete mode 100644 Dockerfile.template delete mode 100644 Makefile delete mode 100644 README.md delete mode 100644 examples/image-with-postgis-clis/Dockerfile delete mode 100644 examples/image-with-postgis-clis/README.md delete mode 100644 test/postgis-config.sh delete mode 100755 test/tests/postgis-basics/run.sh delete mode 100755 update.sh diff --git a/10-2.5/Dockerfile b/10-2.5/Dockerfile deleted file mode 100644 index 18446d8a..00000000 --- a/10-2.5/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:10 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.5+dfsg-1.pgdg90+2 - -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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/10-2.5/README.md b/10-2.5/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/10-2.5/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/10-2.5/alpine/Dockerfile b/10-2.5/alpine/Dockerfile deleted file mode 100644 index 777b8902..00000000 --- a/10-2.5/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:10-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 2.5.5 -ENV POSTGIS_SHA256 24b15ee36f3af02015da0e92a18f9046ea0b4fd24896196c8e6c2aa8e4b56baa - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/10-2.5/alpine/initdb-postgis.sh b/10-2.5/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/10-2.5/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/10-2.5/alpine/update-postgis.sh b/10-2.5/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/10-2.5/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/10-2.5/initdb-postgis.sh b/10-2.5/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/10-2.5/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/10-2.5/update-postgis.sh b/10-2.5/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/10-2.5/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/10-3.1/Dockerfile b/10-3.1/Dockerfile deleted file mode 100644 index 41f7d7ca..00000000 --- a/10-3.1/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:10 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.1.2+dfsg-1~exp2.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 \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /docker-entrypoint-initdb.d -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/10-3.1/README.md b/10-3.1/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/10-3.1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/10-3.1/alpine/Dockerfile b/10-3.1/alpine/Dockerfile deleted file mode 100644 index 6a7bc7bc..00000000 --- a/10-3.1/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:10-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 3.1.2 -ENV POSTGIS_SHA256 c49b6baa4afe4aed6cc7333399897aaf7540b40779a939a4d5a81d0725f6c9f8 - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/10-3.1/alpine/initdb-postgis.sh b/10-3.1/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/10-3.1/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/10-3.1/alpine/update-postgis.sh b/10-3.1/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/10-3.1/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/10-3.1/initdb-postgis.sh b/10-3.1/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/10-3.1/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/10-3.1/update-postgis.sh b/10-3.1/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/10-3.1/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/11-2.5/Dockerfile b/11-2.5/Dockerfile deleted file mode 100644 index 860fd9d9..00000000 --- a/11-2.5/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:11 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.5+dfsg-1.pgdg90+2 - -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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/11-2.5/README.md b/11-2.5/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/11-2.5/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/11-2.5/alpine/Dockerfile b/11-2.5/alpine/Dockerfile deleted file mode 100644 index ba3d5415..00000000 --- a/11-2.5/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:11-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 2.5.5 -ENV POSTGIS_SHA256 24b15ee36f3af02015da0e92a18f9046ea0b4fd24896196c8e6c2aa8e4b56baa - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/11-2.5/alpine/initdb-postgis.sh b/11-2.5/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/11-2.5/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/11-2.5/alpine/update-postgis.sh b/11-2.5/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/11-2.5/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/11-2.5/initdb-postgis.sh b/11-2.5/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/11-2.5/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/11-2.5/update-postgis.sh b/11-2.5/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/11-2.5/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/11-3.1/Dockerfile b/11-3.1/Dockerfile deleted file mode 100644 index 853571ce..00000000 --- a/11-3.1/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:11 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.1.2+dfsg-1~exp2.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 \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /docker-entrypoint-initdb.d -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/11-3.1/README.md b/11-3.1/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/11-3.1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/11-3.1/alpine/Dockerfile b/11-3.1/alpine/Dockerfile deleted file mode 100644 index 4b87e9a3..00000000 --- a/11-3.1/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:11-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 3.1.2 -ENV POSTGIS_SHA256 c49b6baa4afe4aed6cc7333399897aaf7540b40779a939a4d5a81d0725f6c9f8 - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/11-3.1/alpine/initdb-postgis.sh b/11-3.1/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/11-3.1/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/11-3.1/alpine/update-postgis.sh b/11-3.1/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/11-3.1/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/11-3.1/initdb-postgis.sh b/11-3.1/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/11-3.1/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/11-3.1/update-postgis.sh b/11-3.1/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/11-3.1/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/12-2.5/Dockerfile b/12-2.5/Dockerfile deleted file mode 100644 index 86bf0c97..00000000 --- a/12-2.5/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:12 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.5+dfsg-1.pgdg100+2 - -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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/12-2.5/README.md b/12-2.5/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/12-2.5/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/12-2.5/alpine/Dockerfile b/12-2.5/alpine/Dockerfile deleted file mode 100644 index a4c6f025..00000000 --- a/12-2.5/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:12-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 2.5.5 -ENV POSTGIS_SHA256 24b15ee36f3af02015da0e92a18f9046ea0b4fd24896196c8e6c2aa8e4b56baa - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/12-2.5/alpine/initdb-postgis.sh b/12-2.5/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/12-2.5/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/12-2.5/alpine/update-postgis.sh b/12-2.5/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/12-2.5/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/12-2.5/initdb-postgis.sh b/12-2.5/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/12-2.5/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/12-2.5/update-postgis.sh b/12-2.5/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/12-2.5/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/12-3.1/Dockerfile b/12-3.1/Dockerfile deleted file mode 100644 index cdd2b6e5..00000000 --- a/12-3.1/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:12 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.1.2+dfsg-1~exp2.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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/12-3.1/README.md b/12-3.1/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/12-3.1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/12-3.1/alpine/Dockerfile b/12-3.1/alpine/Dockerfile deleted file mode 100644 index 80031461..00000000 --- a/12-3.1/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:12-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 3.1.2 -ENV POSTGIS_SHA256 c49b6baa4afe4aed6cc7333399897aaf7540b40779a939a4d5a81d0725f6c9f8 - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/12-3.1/alpine/initdb-postgis.sh b/12-3.1/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/12-3.1/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/12-3.1/alpine/update-postgis.sh b/12-3.1/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/12-3.1/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/12-3.1/initdb-postgis.sh b/12-3.1/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/12-3.1/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/12-3.1/update-postgis.sh b/12-3.1/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/12-3.1/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/12-master/Dockerfile b/12-master/Dockerfile deleted file mode 100644 index c5f8685a..00000000 --- a/12-master/Dockerfile +++ /dev/null @@ -1,282 +0,0 @@ -# "experimental" ; only for testing! -# multi-stage dockerfile; minimal docker version >= 17.05 -FROM postgres:12 as builder - -LABEL maintainer="PostGIS Project - https://postgis.net" - -WORKDIR / - -# apt-get install -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic1.67.0 \ - libboost-chrono1.67.0 \ - libboost-date-time1.67.0 \ - libboost-filesystem1.67.0 \ - libboost-program-options1.67.0 \ - libboost-serialization1.67.0 \ - libboost-system1.67.0 \ - libboost-test1.67.0 \ - libboost-thread1.67.0 \ - libboost-timer1.67.0 \ - libcgal13 \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c3 \ - libmpfr6 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - # build dependency - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - protobuf-c-compiler \ - xsltproc - -# sfcgal -ENV SFCGAL_VERSION master -ENV SFCGAL_GIT_HASH e4fcf6b2e166a862db568a0419fe100849d3f447 - -RUN set -ex \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && git clone https://gitlab.com/Oslandia/SFCGAL.git \ - && cd SFCGAL \ - && git checkout ${SFCGAL_GIT_HASH} \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake .. \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/SFCGAL - -# proj -ENV PROJ_VERSION master -ENV PROJ_GIT_HASH d902272785a55e48f6b46a907a34a71a5220fccc - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/PROJ.git \ - && cd PROJ \ - && git checkout ${PROJ_GIT_HASH} \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/PROJ - -# geos -ENV GEOS_VERSION master -ENV GEOS_GIT_HASH 1bfc5b27493c552fd9a28823358a4c1f4c3b65f7 - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/libgeos/geos.git \ - && cd geos \ - && git checkout ${GEOS_GIT_HASH} \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake -DCMAKE_BUILD_TYPE=Release .. \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/geos - -# gdal -ENV GDAL_VERSION master -ENV GDAL_GIT_HASH 51e564e9364243be48da5e264c0507d7a9c546d8 - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/gdal.git \ - && cd gdal \ - && git checkout ${GDAL_GIT_HASH} \ - && cd gdal \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/gdal - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version \ - && pcre-config --version - -FROM postgres:12 - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic1.67.0 \ - libboost-chrono1.67.0 \ - libboost-date-time1.67.0 \ - libboost-filesystem1.67.0 \ - libboost-program-options1.67.0 \ - libboost-serialization1.67.0 \ - libboost-system1.67.0 \ - libboost-test1.67.0 \ - libboost-thread1.67.0 \ - libboost-timer1.67.0 \ - libcgal13 \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c3 \ - libmpfr6 \ - libpcre3 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /usr/local /usr/local - -ENV SFCGAL_GIT_HASH e4fcf6b2e166a862db568a0419fe100849d3f447 -ENV PROJ_GIT_HASH d902272785a55e48f6b46a907a34a71a5220fccc -ENV GEOS_GIT_HASH 1bfc5b27493c552fd9a28823358a4c1f4c3b65f7 -ENV GDAL_GIT_HASH 51e564e9364243be48da5e264c0507d7a9c546d8 - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version - -# install postgis -ENV POSTGIS_VERSION master -ENV POSTGIS_GIT_HASH 54a0c748dbb165847c1d0fe3abbe22dd48b8237a - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && cd \ - # postgis - && cd /usr/src/ \ - && git clone https://git.osgeo.org/gitea/postgis/postgis.git \ - && cd postgis \ - && git checkout ${POSTGIS_GIT_HASH} \ - && ./autogen.sh \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie - && ./configure \ -# --with-gui \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && ldconfig \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apt-get purge -y --autoremove \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /docker-entrypoint-initdb.d -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/12-master/README.md b/12-master/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/12-master/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/12-master/initdb-postgis.sh b/12-master/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/12-master/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/12-master/update-postgis.sh b/12-master/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/12-master/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/13-3.1/Dockerfile b/13-3.1/Dockerfile deleted file mode 100644 index 6d84fdd7..00000000 --- a/13-3.1/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:13 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.1.2+dfsg-1~exp2.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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/13-3.1/README.md b/13-3.1/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/13-3.1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/13-3.1/alpine/Dockerfile b/13-3.1/alpine/Dockerfile deleted file mode 100644 index e8e0ed48..00000000 --- a/13-3.1/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:13-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 3.1.2 -ENV POSTGIS_SHA256 c49b6baa4afe4aed6cc7333399897aaf7540b40779a939a4d5a81d0725f6c9f8 - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/13-3.1/alpine/initdb-postgis.sh b/13-3.1/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/13-3.1/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/13-3.1/alpine/update-postgis.sh b/13-3.1/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/13-3.1/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/13-3.1/initdb-postgis.sh b/13-3.1/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/13-3.1/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/13-3.1/update-postgis.sh b/13-3.1/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/13-3.1/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/13-master/Dockerfile b/13-master/Dockerfile deleted file mode 100644 index 6252e04a..00000000 --- a/13-master/Dockerfile +++ /dev/null @@ -1,282 +0,0 @@ -# "experimental" ; only for testing! -# multi-stage dockerfile; minimal docker version >= 17.05 -FROM postgres:13 as builder - -LABEL maintainer="PostGIS Project - https://postgis.net" - -WORKDIR / - -# apt-get install -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic1.67.0 \ - libboost-chrono1.67.0 \ - libboost-date-time1.67.0 \ - libboost-filesystem1.67.0 \ - libboost-program-options1.67.0 \ - libboost-serialization1.67.0 \ - libboost-system1.67.0 \ - libboost-test1.67.0 \ - libboost-thread1.67.0 \ - libboost-timer1.67.0 \ - libcgal13 \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c3 \ - libmpfr6 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - # build dependency - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - protobuf-c-compiler \ - xsltproc - -# sfcgal -ENV SFCGAL_VERSION master -ENV SFCGAL_GIT_HASH e4fcf6b2e166a862db568a0419fe100849d3f447 - -RUN set -ex \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && git clone https://gitlab.com/Oslandia/SFCGAL.git \ - && cd SFCGAL \ - && git checkout ${SFCGAL_GIT_HASH} \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake .. \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/SFCGAL - -# proj -ENV PROJ_VERSION master -ENV PROJ_GIT_HASH d902272785a55e48f6b46a907a34a71a5220fccc - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/PROJ.git \ - && cd PROJ \ - && git checkout ${PROJ_GIT_HASH} \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/PROJ - -# geos -ENV GEOS_VERSION master -ENV GEOS_GIT_HASH 1bfc5b27493c552fd9a28823358a4c1f4c3b65f7 - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/libgeos/geos.git \ - && cd geos \ - && git checkout ${GEOS_GIT_HASH} \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake -DCMAKE_BUILD_TYPE=Release .. \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/geos - -# gdal -ENV GDAL_VERSION master -ENV GDAL_GIT_HASH 51e564e9364243be48da5e264c0507d7a9c546d8 - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/gdal.git \ - && cd gdal \ - && git checkout ${GDAL_GIT_HASH} \ - && cd gdal \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/gdal - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version \ - && pcre-config --version - -FROM postgres:13 - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic1.67.0 \ - libboost-chrono1.67.0 \ - libboost-date-time1.67.0 \ - libboost-filesystem1.67.0 \ - libboost-program-options1.67.0 \ - libboost-serialization1.67.0 \ - libboost-system1.67.0 \ - libboost-test1.67.0 \ - libboost-thread1.67.0 \ - libboost-timer1.67.0 \ - libcgal13 \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c3 \ - libmpfr6 \ - libpcre3 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /usr/local /usr/local - -ENV SFCGAL_GIT_HASH e4fcf6b2e166a862db568a0419fe100849d3f447 -ENV PROJ_GIT_HASH d902272785a55e48f6b46a907a34a71a5220fccc -ENV GEOS_GIT_HASH 1bfc5b27493c552fd9a28823358a4c1f4c3b65f7 -ENV GDAL_GIT_HASH 51e564e9364243be48da5e264c0507d7a9c546d8 - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version - -# install postgis -ENV POSTGIS_VERSION master -ENV POSTGIS_GIT_HASH 54a0c748dbb165847c1d0fe3abbe22dd48b8237a - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && cd \ - # postgis - && cd /usr/src/ \ - && git clone https://git.osgeo.org/gitea/postgis/postgis.git \ - && cd postgis \ - && git checkout ${POSTGIS_GIT_HASH} \ - && ./autogen.sh \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie - && ./configure \ -# --with-gui \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && ldconfig \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apt-get purge -y --autoremove \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /docker-entrypoint-initdb.d -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/13-master/README.md b/13-master/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/13-master/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/13-master/initdb-postgis.sh b/13-master/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/13-master/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/13-master/update-postgis.sh b/13-master/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/13-master/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/14beta2-3.1/Dockerfile b/14beta2-3.1/Dockerfile deleted file mode 100644 index 5a29a61b..00000000 --- a/14beta2-3.1/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:14beta2 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.1.2+dfsg-1~exp2.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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/14beta2-3.1/README.md b/14beta2-3.1/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/14beta2-3.1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/14beta2-3.1/alpine/Dockerfile b/14beta2-3.1/alpine/Dockerfile deleted file mode 100644 index 4341864d..00000000 --- a/14beta2-3.1/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:14beta2-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 3.1.3 -ENV POSTGIS_SHA256 885e11b26d8385aff49e605d33749a83e711180a3b1996395564ddf6346f3bb4 - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/14beta2-3.1/alpine/initdb-postgis.sh b/14beta2-3.1/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/14beta2-3.1/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/14beta2-3.1/alpine/update-postgis.sh b/14beta2-3.1/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/14beta2-3.1/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/14beta2-3.1/initdb-postgis.sh b/14beta2-3.1/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/14beta2-3.1/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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/14beta2-3.1/update-postgis.sh b/14beta2-3.1/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/14beta2-3.1/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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-2.5/Dockerfile b/9.6-2.5/Dockerfile deleted file mode 100644 index 8dfc59ee..00000000 --- a/9.6-2.5/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:9.6 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 2.5 -ENV POSTGIS_VERSION 2.5.5+dfsg-1.pgdg90+2 - -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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/9.6-2.5/README.md b/9.6-2.5/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/9.6-2.5/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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-2.5/alpine/Dockerfile deleted file mode 100644 index 6639c7d7..00000000 --- a/9.6-2.5/alpine/Dockerfile +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:9.6-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION 2.5.5 -ENV POSTGIS_SHA256 24b15ee36f3af02015da0e92a18f9046ea0b4fd24896196c8e6c2aa8e4b56baa - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/9.6-2.5/alpine/initdb-postgis.sh b/9.6-2.5/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/9.6-2.5/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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-2.5/alpine/update-postgis.sh b/9.6-2.5/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/9.6-2.5/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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-2.5/initdb-postgis.sh b/9.6-2.5/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/9.6-2.5/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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-2.5/update-postgis.sh b/9.6-2.5/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/9.6-2.5/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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.1/Dockerfile b/9.6-3.1/Dockerfile deleted file mode 100644 index 4eee3f4a..00000000 --- a/9.6-3.1/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:9.6 - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR 3 -ENV POSTGIS_VERSION 3.1.2+dfsg-1~exp2.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 \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /docker-entrypoint-initdb.d -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/9.6-3.1/README.md b/9.6-3.1/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/9.6-3.1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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-3.1/alpine/initdb-postgis.sh b/9.6-3.1/alpine/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/9.6-3.1/alpine/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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.1/alpine/update-postgis.sh b/9.6-3.1/alpine/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/9.6-3.1/alpine/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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.1/initdb-postgis.sh b/9.6-3.1/initdb-postgis.sh deleted file mode 100644 index cdde274f..00000000 --- a/9.6-3.1/initdb-postgis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 IS_TEMPLATE true; -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.1/update-postgis.sh b/9.6-3.1/update-postgis.sh deleted file mode 100755 index f98abd26..00000000 --- a/9.6-3.1/update-postgis.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/AUTHORS b/AUTHORS deleted file mode 100644 index d2f5445a..00000000 --- a/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Mike Dillon - -And other contributors not specifically named here. diff --git a/9.6-3.1/alpine/Dockerfile b/Dockerfile similarity index 100% rename from 9.6-3.1/alpine/Dockerfile rename to Dockerfile diff --git a/Dockerfile.alpine.template b/Dockerfile.alpine.template deleted file mode 100644 index b66512d9..00000000 --- a/Dockerfile.alpine.template +++ /dev/null @@ -1,110 +0,0 @@ -FROM postgres:%%PG_MAJOR%%-alpine - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_VERSION %%POSTGIS_VERSION%% -ENV POSTGIS_SHA256 %%POSTGIS_SHA256%% - -#Temporary fix: -# for PostGIS 2.* - building a special geos -# reason: PostGIS 2.5.5 is not working with GEOS 3.9.* -ENV POSTGIS2_GEOS_VERSION tags/3.8.2 - -RUN set -eux \ - \ - && 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 \ - clang-dev \ - file \ - g++ \ - gcc \ - gdal-dev \ - gettext-dev \ - json-c-dev \ - libtool \ - libxml2-dev \ - llvm11-dev \ - make \ - pcre-dev \ - perl \ - proj-dev \ - protobuf-c-dev \ - \ -# GEOS setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .build-deps-geos geos-dev cunit-dev ; \ - elif [ $(printf %.1s "$POSTGIS_VERSION") == 2 ]; then \ - apk add --no-cache --virtual .build-deps-geos cmake git ; \ - cd /usr/src ; \ - git clone https://github.com/libgeos/geos.git ; \ - cd geos ; \ - git checkout ${POSTGIS2_GEOS_VERSION} -b geos_build ; \ - mkdir cmake-build ; \ - cd cmake-build ; \ - cmake -DCMAKE_BUILD_TYPE=Release .. ; \ - make -j$(nproc) ; \ - make check ; \ - make install ; \ - cd / ; \ - rm -fr /usr/src/geos ; \ - else \ - echo ".... unknown PosGIS ...." ; \ - fi \ - \ -# build PostGIS - \ - && cd /usr/src/postgis \ - && gettextize \ - && ./autogen.sh \ - && ./configure \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ - \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - #&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \ - #&& make garden PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# add .postgis-rundeps - && apk add --no-cache --virtual .postgis-rundeps \ - gdal \ - json-c \ - libstdc++ \ - pcre \ - proj \ - protobuf-c \ - # Geos setup - && if [ $(printf %.1s "$POSTGIS_VERSION") == 3 ]; then \ - apk add --no-cache --virtual .postgis-rundeps-geos geos ; \ - fi \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apk del .fetch-deps .build-deps .build-deps-geos - -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin diff --git a/Dockerfile.master.template b/Dockerfile.master.template deleted file mode 100644 index e8fed9a5..00000000 --- a/Dockerfile.master.template +++ /dev/null @@ -1,282 +0,0 @@ -# "experimental" ; only for testing! -# multi-stage dockerfile; minimal docker version >= 17.05 -FROM postgres:%%PG_MAJOR%% as builder - -LABEL maintainer="PostGIS Project - https://postgis.net" - -WORKDIR / - -# apt-get install -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic%%BOOST_VERSION%% \ - libboost-chrono%%BOOST_VERSION%% \ - libboost-date-time%%BOOST_VERSION%% \ - libboost-filesystem%%BOOST_VERSION%% \ - libboost-program-options%%BOOST_VERSION%% \ - libboost-serialization%%BOOST_VERSION%% \ - libboost-system%%BOOST_VERSION%% \ - libboost-test%%BOOST_VERSION%% \ - libboost-thread%%BOOST_VERSION%% \ - libboost-timer%%BOOST_VERSION%% \ - libcgal%%CDAL_VERSION%% \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c3 \ - libmpfr6 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - # build dependency - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - protobuf-c-compiler \ - xsltproc - -# sfcgal -ENV SFCGAL_VERSION master -ENV SFCGAL_GIT_HASH %%SFCGAL_GIT_HASH%% - -RUN set -ex \ - && mkdir -p /usr/src \ - && cd /usr/src \ - && git clone https://gitlab.com/Oslandia/SFCGAL.git \ - && cd SFCGAL \ - && git checkout ${SFCGAL_GIT_HASH} \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake .. \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/SFCGAL - -# proj -ENV PROJ_VERSION master -ENV PROJ_GIT_HASH %%PROJ_GIT_HASH%% - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/PROJ.git \ - && cd PROJ \ - && git checkout ${PROJ_GIT_HASH} \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/PROJ - -# geos -ENV GEOS_VERSION master -ENV GEOS_GIT_HASH %%GEOS_GIT_HASH%% - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/libgeos/geos.git \ - && cd geos \ - && git checkout ${GEOS_GIT_HASH} \ - && mkdir cmake-build \ - && cd cmake-build \ - && cmake -DCMAKE_BUILD_TYPE=Release .. \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/geos - -# gdal -ENV GDAL_VERSION master -ENV GDAL_GIT_HASH %%GDAL_GIT_HASH%% - -RUN set -ex \ - && cd /usr/src \ - && git clone https://github.com/OSGeo/gdal.git \ - && cd gdal \ - && git checkout ${GDAL_GIT_HASH} \ - && cd gdal \ - && ./autogen.sh \ - && ./configure --disable-static \ - && make -j$(nproc) \ - && make install \ - && cd / \ - && rm -fr /usr/src/gdal - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version \ - && pcre-config --version - -FROM postgres:%%PG_MAJOR%% - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ - libboost-atomic%%BOOST_VERSION%% \ - libboost-chrono%%BOOST_VERSION%% \ - libboost-date-time%%BOOST_VERSION%% \ - libboost-filesystem%%BOOST_VERSION%% \ - libboost-program-options%%BOOST_VERSION%% \ - libboost-serialization%%BOOST_VERSION%% \ - libboost-system%%BOOST_VERSION%% \ - libboost-test%%BOOST_VERSION%% \ - libboost-thread%%BOOST_VERSION%% \ - libboost-timer%%BOOST_VERSION%% \ - libcgal%%CDAL_VERSION%% \ - libcurl3-gnutls \ - libexpat1 \ - libgmp10 \ - libgmpxx4ldbl \ - libjson-c3 \ - libmpfr6 \ - libpcre3 \ - libprotobuf-c1 \ - libtiff5 \ - libxml2 \ - sqlite3 \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /usr/local /usr/local - -ENV SFCGAL_GIT_HASH %%SFCGAL_GIT_HASH%% -ENV PROJ_GIT_HASH %%PROJ_GIT_HASH%% -ENV GEOS_GIT_HASH %%GEOS_GIT_HASH%% -ENV GDAL_GIT_HASH %%GDAL_GIT_HASH%% - -# Minimal command line test. -RUN set -ex \ - && ldconfig \ - && cs2cs \ - && gdalinfo --version \ - && geos-config --version \ - && ogr2ogr --version \ - && proj \ - && sfcgal-config --version - -# install postgis -ENV POSTGIS_VERSION master -ENV POSTGIS_GIT_HASH %%POSTGIS_GIT_HASH%% - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && cd \ - # postgis - && cd /usr/src/ \ - && git clone https://git.osgeo.org/gitea/postgis/postgis.git \ - && cd postgis \ - && git checkout ${POSTGIS_GIT_HASH} \ - && ./autogen.sh \ -# configure options taken from: -# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie - && ./configure \ -# --with-gui \ - --with-pcredir="$(pcre-config --prefix)" \ - && make -j$(nproc) \ - && make install \ -# regress check - && mkdir /tempdb \ - && chown -R postgres:postgres /tempdb \ - && su postgres -c 'pg_ctl -D /tempdb init' \ - && su postgres -c 'pg_ctl -D /tempdb start' \ - && ldconfig \ - && cd regress \ - && make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \ - && su postgres -c 'pg_ctl -D /tempdb --mode=immediate stop' \ - && rm -rf /tempdb \ - && rm -rf /tmp/pgis_reg \ -# clean - && cd / \ - && rm -rf /usr/src/postgis \ - && apt-get purge -y --autoremove \ - autoconf \ - automake \ - autotools-dev \ - bison \ - build-essential \ - ca-certificates \ - cmake \ - g++ \ - git \ - libboost-all-dev \ - libcgal-dev \ - libcurl4-gnutls-dev \ - libgmp-dev \ - libjson-c-dev \ - libmpfr-dev \ - libpcre3-dev \ - libprotobuf-c-dev \ - libsqlite3-dev \ - libtiff-dev \ - libtool \ - libxml2-dev \ - make \ - pkg-config \ - postgresql-server-dev-$PG_MAJOR \ - protobuf-c-compiler \ - xsltproc \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /docker-entrypoint-initdb.d -COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/Dockerfile.template b/Dockerfile.template deleted file mode 100644 index 0f8ecff9..00000000 --- a/Dockerfile.template +++ /dev/null @@ -1,18 +0,0 @@ -FROM postgres:%%PG_MAJOR%% - -LABEL maintainer="PostGIS Project - https://postgis.net" - -ENV POSTGIS_MAJOR %%POSTGIS_MAJOR%% -ENV POSTGIS_VERSION %%POSTGIS_VERSION%% - -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/10_postgis.sh -COPY ./update-postgis.sh /usr/local/bin - diff --git a/Makefile b/Makefile deleted file mode 100644 index eda5dbff..00000000 --- a/Makefile +++ /dev/null @@ -1,149 +0,0 @@ - -# When processing the rules for tagging and pushing container images with the -# "latest" tag, the following variable will be the version that is considered -# to be the latest. -LATEST_VERSION=13-3.1 - -# The following flags are set based on VERSION and VARIANT environment variables -# that may have been specified, and are used by rules to determine which -# versions/variants are to be processed. If no VERSION or VARIANT environment -# variables were specified, process everything (the default). -do_default=true -do_alpine=true - -# The following logic evaluates VERSION and VARIANT variables that may have -# been previously specified, and modifies the "do" flags depending on the values. -# The VERSIONS variable is also set to contain the version(s) to be processed. -ifdef VERSION - VERSIONS=$(VERSION) # If a version was specified, VERSIONS only contains the specified version - ifdef VARIANT # If a variant is specified, unset all do flags and allow subsequent logic to set them again where appropriate - do_default=false - do_alpine=false - ifeq ($(VARIANT),default) - do_default=true - endif - ifeq ($(VARIANT),alpine) - do_alpine=true - endif - endif - ifeq ("$(wildcard $(VERSION)/alpine)","") # If no alpine subdirectory exists, don't process the alpine version - do_alpine=false - endif -else # If no version was specified, VERSIONS should contain all versions - VERSIONS = $(foreach df,$(wildcard */Dockerfile),$(df:%/Dockerfile=%)) -endif - -# The "latest" tag will only be provided for default images (no variant) so -# only define the dependencies when the default image will be built. -ifeq ($(do_default),true) - BUILD_LATEST_DEP=build-$(LATEST_VERSION) - PUSH_LATEST_DEP=push-$(LATEST_VERSION) - PUSH_DEP=push-latest $(PUSH_LATEST_DEP) - # The "latest" tag shouldn't be processed if a VERSION was explicitly - # specified but does not correspond to the latest version. - ifdef VERSION - ifneq ($(VERSION),$(LATEST_VERSION)) - PUSH_LATEST_DEP= - BUILD_LATEST_DEP= - PUSH_DEP= - endif - endif -endif - -# The repository and image names default to the official but can be overriden -# via environment variables. -REPO_NAME ?= postgis -IMAGE_NAME ?= postgis - -DOCKER=docker -DOCKERHUB_DESC_IMG=peterevans/dockerhub-description:2.1.0 - -GIT=git -OFFIMG_LOCAL_CLONE=$(HOME)/official-images -OFFIMG_REPO_URL=https://github.com/docker-library/official-images.git - - -build: $(foreach version,$(VERSIONS),build-$(version)) - -all: update build test - -update: - $(DOCKER) run --rm -v $$(pwd):/work -w /work buildpack-deps ./update.sh - - -### RULES FOR BUILDING ### - -define build-version -build-$1: -ifeq ($(do_default),true) - $(DOCKER) build --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1) $1 -endif -ifeq ($(do_alpine),true) -ifneq ("$(wildcard $1/alpine)","") - $(DOCKER) build --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1)-alpine $1/alpine -endif -endif -endef -$(foreach version,$(VERSIONS),$(eval $(call build-version,$(version)))) - - -## RULES FOR TESTING ### - -test-prepare: -ifeq ("$(wildcard $(OFFIMG_LOCAL_CLONE))","") - $(GIT) clone $(OFFIMG_REPO_URL) $(OFFIMG_LOCAL_CLONE) -endif - -test: $(foreach version,$(VERSIONS),test-$(version)) - -define test-version -test-$1: test-prepare build-$1 -ifeq ($(do_default),true) - $(OFFIMG_LOCAL_CLONE)/test/run.sh -c $(OFFIMG_LOCAL_CLONE)/test/config.sh -c test/postgis-config.sh $(REPO_NAME)/$(IMAGE_NAME):$(version) -endif -ifeq ($(do_alpine),true) -ifneq ("$(wildcard $1/alpine)","") - $(OFFIMG_LOCAL_CLONE)/test/run.sh -c $(OFFIMG_LOCAL_CLONE)/test/config.sh -c test/postgis-config.sh $(REPO_NAME)/$(IMAGE_NAME):$(version)-alpine -endif -endif -endef -$(foreach version,$(VERSIONS),$(eval $(call test-version,$(version)))) - - -### RULES FOR TAGGING ### - -tag-latest: $(BUILD_LATEST_DEP) - $(DOCKER) image tag $(REPO_NAME)/$(IMAGE_NAME):$(LATEST_VERSION) $(REPO_NAME)/$(IMAGE_NAME):latest - - -### RULES FOR PUSHING ### - -push: $(foreach version,$(VERSIONS),push-$(version)) $(PUSH_DEP) - -define push-version -push-$1: test-$1 -ifeq ($(do_default),true) - $(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):$(version) -endif -ifeq ($(do_alpine),true) -ifneq ("$(wildcard $1/alpine)","") - $(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):$(version)-alpine -endif -endif -endef -$(foreach version,$(VERSIONS),$(eval $(call push-version,$(version)))) - -push-latest: tag-latest $(PUSH_LATEST_DEP) - $(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):latest - @$(DOCKER) run -v "$(PWD)":/workspace \ - -e DOCKERHUB_USERNAME='$(DOCKERHUB_USERNAME)' \ - -e DOCKERHUB_PASSWORD='$(DOCKERHUB_PASSWORD)' \ - -e DOCKERHUB_REPOSITORY='$(REPO_NAME)/$(IMAGE_NAME)' \ - -e README_FILEPATH='/workspace/README.md' $(DOCKERHUB_DESC_IMG) - - -.PHONY: build all update test-prepare test tag-latest push push-latest \ - $(foreach version,$(VERSIONS),build-$(version)) \ - $(foreach version,$(VERSIONS),test-$(version)) \ - $(foreach version,$(VERSIONS),push-$(version)) - diff --git a/README.md b/README.md deleted file mode 100644 index b1f881a0..00000000 --- a/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# postgis/postgis - -[![Build Status](https://github.com/postgis/docker-postgis/workflows/Docker%20PostGIS%20CI/badge.svg)](https://github.com/postgis/docker-postgis/actions) [![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) - -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.1.x for each supported version of Postgres (9.5, 9.6, 10, 11, 12 and 13). Additionally, an image version is provided which is built from the latest version of Postgres (13) with versions of PostGIS and its dependencies built from their respective master branches. - -This image ensures that the default database created by the parent `postgres` image will have the following extensions installed: - -* `postgis` -* `postgis_topology` -* `postgis_tiger_geocoder` - -Note: As of PostGIS v3.x, raster has been factored out into a separate extension `postgis_raster` which must be installed separately. - -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 postgis/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 either directly on the running container: - - docker exec -ti some-postgis psql -U postgres - -... or starting a new container to run as a client. In this case you can use a user-defined network to link both containers: - - docker network create some-network - - # Server container - docker run --name some-postgis --network some-network -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis - - # Client container - docker run -it --rm --network some-network postgis/postgis psql -h some-postgis -U postgres - -Check the documentation on the [`postgres` image](https://registry.hub.docker.com/_/postgres/) and [Docker networking](https://docs.docker.com/network/) for more details and alternatives on connecting different containers. - -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/examples/image-with-postgis-clis/Dockerfile b/examples/image-with-postgis-clis/Dockerfile deleted file mode 100644 index 20aaf5a8..00000000 --- a/examples/image-with-postgis-clis/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM postgis/postgis:13-3.1 - -RUN apt-get update -y -RUN apt-get install postgis -y -RUN apt-get clean -RUN rm -rf /var/cache/apt/lists \ No newline at end of file diff --git a/examples/image-with-postgis-clis/README.md b/examples/image-with-postgis-clis/README.md deleted file mode 100644 index f0d07e26..00000000 --- a/examples/image-with-postgis-clis/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Using PostGIS CLIs -The base postgis/postgis image does not have PostGIS-related CLIs installed. To use PostGIS CLIs that are NOT installed by default (for example `raster2pgsql`) it's necessary to extend the base image. - -```sh -# Create a Docker image -docker build -t my-postgis . - -# Run as a Docker container -docker run --name my-postgis -p 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=password -d my-postgis -``` \ No newline at end of file diff --git a/test/postgis-config.sh b/test/postgis-config.sh deleted file mode 100644 index 39027796..00000000 --- a/test/postgis-config.sh +++ /dev/null @@ -1,5 +0,0 @@ -testAlias[postgis/postgis]=postgres - -imageTests[postgis/postgis]=' - postgis-basics -' diff --git a/test/tests/postgis-basics/run.sh b/test/tests/postgis-basics/run.sh deleted file mode 100755 index d04be5ac..00000000 --- a/test/tests/postgis-basics/run.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -set -e - -image="$1" - -export POSTGRES_USER='my cool postgres user' -export POSTGRES_PASSWORD='my cool postgres password' -export POSTGRES_DB='my cool postgres database' - -cname="postgis-container-$RANDOM-$RANDOM" -cid="$(docker run -d -e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB --name "$cname" "$image")" -trap "docker rm -vf $cid > /dev/null" EXIT - -psql() { - docker run --rm -i \ - --link "$cname":postgis \ - --entrypoint psql \ - -e PGPASSWORD="$POSTGRES_PASSWORD" \ - "$image" \ - --host postgis \ - --username "$POSTGRES_USER" \ - --dbname "$POSTGRES_DB" \ - --quiet --no-align --tuples-only \ - "$@" -} - -tries=10 -while ! echo 'SELECT 1' | psql &> /dev/null; do - (( tries-- )) - if [ $tries -le 0 ]; then - echo >&2 'postgres failed to accept connections in a reasonable amount of time!' - echo 'SELECT 1' | psql # to hopefully get a useful error message - false - fi - sleep 2 -done - -echo 'SELECT PostGIS_Version()' | psql -[ "$(echo 'SELECT ST_X(ST_Point(0,0))' | psql)" = 0 ] - - -## test address_standardizer extension -echo 'CREATE EXTENSION address_standardizer;' | psql -response=$(echo $'SELECT zip FROM parse_address(\'1 Devonshire Place, Boston, MA 02109-1234\') AS a;' | psql) -if [ $response = 02109 ]; then - echo "address_standardizer extension installed and works!" -else - echo "address_standardizer extension test failed, returned response is $response" - exit 1 -fi - diff --git a/update.sh b/update.sh deleted file mode 100755 index 5442f070..00000000 --- a/update.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# Derived from https://github.com/docker-library/postgres/blob/master/update.sh -set -Eeuo pipefail - -cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" - -versions=( "$@" ) -if [ ${#versions[@]} -eq 0 ]; then - versions=( */Dockerfile ) -fi -versions=( "${versions[@]%/Dockerfile}" ) - -# sort version numbers with highest last (so it goes first in .travis.yml) -IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -V) ); unset IFS - -defaultDebianSuite='buster-slim' -declare -A debianSuite=( - # https://github.com/docker-library/postgres/issues/582 - [9.6]='stretch-slim' - [10]='stretch-slim' - [11]='stretch-slim' - [12]='buster-slim' - [13]='buster-slim' - [14]='buster-slim' - [14beta2]='buster-slim' -) - -defaultPostgisDebPkgNameVersionSuffix='3' -declare -A postgisDebPkgNameVersionSuffixes=( - [2.5]='2.5' - [3.0]='3' - [3.1]='3' -) - -packagesBase='http://apt.postgresql.org/pub/repos/apt/dists/' - -sfcgalGitHash="$(git ls-remote https://gitlab.com/Oslandia/SFCGAL.git heads/master | awk '{ print $1}')" -projGitHash="$(git ls-remote https://github.com/OSGeo/PROJ.git heads/master | awk '{ print $1}')" -gdalGitHash="$(git ls-remote https://github.com/OSGeo/gdal.git refs/heads/master | grep '\srefs/heads/master' | awk '{ print $1}')" -geosGitHash="$(git ls-remote https://github.com/libgeos/geos.git heads/main | awk '{ print $1}')" -postgisGitHash="$(git ls-remote https://git.osgeo.org/gitea/postgis/postgis.git heads/main | awk '{ print $1}')" - -declare -A suitePackageList=() suiteArches=() -travisEnv= -for version in "${versions[@]}"; do - IFS=- read postgresVersion postgisVersion <<< "$version" - - tag="${debianSuite[$postgresVersion]:-$defaultDebianSuite}" - suite="${tag%%-slim}" - - if [ -z "${suitePackageList["$suite"]:+isset}" ]; then - suitePackageList["$suite"]="$(curl -fsSL "${packagesBase}/${suite}-pgdg/main/binary-amd64/Packages.bz2" | bunzip2)" - fi - if [ -z "${suiteArches["$suite"]:+isset}" ]; then - suiteArches["$suite"]="$(curl -fsSL "${packagesBase}/${suite}-pgdg/Release" | awk -F ':[[:space:]]+' '$1 == "Architectures" { gsub(/[[:space:]]+/, "|", $2); print $2 }')" - fi - - postgresVersionMain="$(echo "$postgresVersion" | awk -F 'beta' '{print $1}')" - versionList="$(echo "${suitePackageList["$suite"]}"; curl -fsSL "${packagesBase}/${suite}-pgdg/${postgresVersionMain}/binary-amd64/Packages.bz2" | bunzip2)" - fullVersion="$(echo "$versionList" | awk -F ': ' '$1 == "Package" { pkg = $2 } $1 == "Version" && pkg == "postgresql-'"$postgresVersionMain"'" { print $2; exit }' || true)" - majorVersion="${postgresVersion%%.*}" - - if [ "$suite" = "stretch" ]; then - boostVersion="1.62.0" - cdalVersion="12" - else - boostVersion="1.67.0" - cdalVersion="13" - fi - - if [ "master" == "$postgisVersion" ]; then - postgisPackageName="" - postgisFullVersion="$postgisVersion" - postgisMajor="" - else - postgisPackageName="postgresql-${postgresVersionMain}-postgis-${postgisDebPkgNameVersionSuffixes[${postgisVersion}]}" - postgisFullVersion="$(echo "$versionList" | awk -F ': ' '$1 == "Package" { pkg = $2 } $1 == "Version" && pkg == "'"$postgisPackageName"'" { print $2; exit }' || true)" - postgisMajor="${postgisDebPkgNameVersionSuffixes[${postgisVersion}]}" - fi - ( - set -x - cp -p Dockerfile.template initdb-postgis.sh update-postgis.sh README.md "$version/" - if [ "master" == "$postgisVersion" ]; then - cp -p Dockerfile.master.template "$version/Dockerfile.template" - fi - mv "$version/Dockerfile.template" "$version/Dockerfile" - sed -i 's/%%PG_MAJOR%%/'$postgresVersion'/g; s/%%POSTGIS_MAJOR%%/'$postgisMajor'/g; s/%%POSTGIS_VERSION%%/'$postgisFullVersion'/g; s/%%POSTGIS_GIT_HASH%%/'$postgisGitHash'/g; s/%%SFCGAL_GIT_HASH%%/'$sfcgalGitHash'/g; s/%%PROJ_GIT_HASH%%/'$projGitHash'/g; s/%%GDAL_GIT_HASH%%/'$gdalGitHash'/g; s/%%GEOS_GIT_HASH%%/'$geosGitHash'/g; s/%%BOOST_VERSION%%/'"$boostVersion"'/g; s/%%CDAL_VERSION%%/'"$cdalVersion"'/g;' "$version/Dockerfile" - ) - - if [ "master" == "$postgisVersion" ]; then - srcVersion="" - srcSha256="" - else - srcVersion="${postgisFullVersion%%+*}" - srcSha256="$(curl -sSL "https://github.com/postgis/postgis/archive/$srcVersion.tar.gz" | sha256sum | awk '{ print $1 }')" - fi - for variant in alpine; do - if [ ! -d "$version/$variant" ]; then - continue - fi - ( - set -x - cp -p Dockerfile.alpine.template initdb-postgis.sh update-postgis.sh "$version/$variant/" - mv "$version/$variant/Dockerfile.alpine.template" "$version/$variant/Dockerfile" - sed -i 's/%%PG_MAJOR%%/'"$postgresVersion"'/g; s/%%POSTGIS_VERSION%%/'"$srcVersion"'/g; s/%%POSTGIS_SHA256%%/'"$srcSha256"'/g' "$version/$variant/Dockerfile" - ) - travisEnv="\n - VERSION=$version VARIANT=$variant$travisEnv" - done - travisEnv='\n - VERSION='"$version$travisEnv" - -done -#travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" - -# *** TRAVIS IS DISABLED FOR NOW *** -#echo "$travis" > .travis.yml -