forked from postgis/docker-postgis
-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for Postgres 16 with PostGIS 3.4 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
acidtv
wants to merge
3
commits into
master
Choose a base branch
from
add-16-3.4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Base image: PostgreSQL 16 on Bullseye (amd64/arm64) | ||
| FROM postgres:16-bullseye | ||
|
|
||
| LABEL maintainer="PostGIS Project - https://postgis.net" \ | ||
| org.opencontainers.image.description="PostGIS 3.4.3 spatial extension with PostgreSQL 16, built from source" \ | ||
| org.opencontainers.image.source="https://github.com/postgis/docker-postgis" | ||
|
|
||
| ENV POSTGIS_MAJOR=3 | ||
| ENV POSTGIS_VERSION=3.4.3 | ||
| ENV PG_MAJOR=16 | ||
|
|
||
| # Install build dependencies for PostGIS | ||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| wget \ | ||
| curl \ | ||
| gnupg \ | ||
| software-properties-common \ | ||
| autoconf \ | ||
| automake \ | ||
| libtool \ | ||
| pkg-config \ | ||
| libxml2-dev \ | ||
| libgeos-dev \ | ||
| libproj-dev \ | ||
| libgdal-dev \ | ||
| libjson-c-dev \ | ||
| libprotobuf-c-dev \ | ||
| libsqlite3-dev \ | ||
| libcurl4-openssl-dev \ | ||
| libreadline-dev \ | ||
| liblzma-dev \ | ||
| libpcre2-dev \ | ||
| bison \ | ||
| flex \ | ||
| postgresql-server-dev-$PG_MAJOR \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Download and build PostGIS 3.4.3 from source | ||
| WORKDIR /usr/src | ||
| RUN wget -qO postgis.tar.gz "https://download.osgeo.org/postgis/source/postgis-$POSTGIS_VERSION.tar.gz" \ | ||
| && tar xzf postgis.tar.gz \ | ||
| && rm postgis.tar.gz \ | ||
| && cd postgis-$POSTGIS_VERSION \ | ||
| && ./configure --with-pgconfig=/usr/lib/postgresql/$PG_MAJOR/bin/pg_config --without-protobuf \ | ||
| && make \ | ||
| && make install | ||
|
|
||
| # Clean up source directory | ||
| RUN rm -rf /usr/src/postgis-$POSTGIS_VERSION | ||
|
|
||
| # Init scripts directory | ||
| 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 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/bash | ||
|
|
||
| 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; | ||
| -- Reconnect to update pg_setting.resetval | ||
| -- See https://github.com/postgis/docker-postgis/issues/288 | ||
| \c | ||
| CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; | ||
| CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder; | ||
| EOSQL | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -e | ||
|
|
||
| # Perform all actions as $POSTGRES_USER | ||
| export PGUSER="$POSTGRES_USER" | ||
|
|
||
| POSTGIS_VERSION="${POSTGIS_VERSION%%+*}" | ||
|
|
||
| # Load PostGIS into both template_database and $POSTGRES_DB | ||
| for DB in template_postgis "$POSTGRES_DB" "${@}"; do | ||
| echo "Updating PostGIS extensions '$DB' to $POSTGIS_VERSION" | ||
| psql --dbname="$DB" -c " | ||
| -- Upgrade PostGIS (includes raster) | ||
| CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION'; | ||
| ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION'; | ||
|
|
||
| -- Upgrade Topology | ||
| CREATE EXTENSION IF NOT EXISTS postgis_topology VERSION '$POSTGIS_VERSION'; | ||
| ALTER EXTENSION postgis_topology UPDATE TO '$POSTGIS_VERSION'; | ||
|
|
||
| -- Install Tiger dependencies in case not already installed | ||
| CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; | ||
| -- Upgrade US Tiger Geocoder | ||
| CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder VERSION '$POSTGIS_VERSION'; | ||
| ALTER EXTENSION postgis_tiger_geocoder UPDATE TO '$POSTGIS_VERSION'; | ||
| " | ||
| done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De shellscripts heb ik niet aangepast, die zijn gekopieerd uit
16-3.5.