Skip to content

Commit d0c36b1

Browse files
committed
more README.md change + ./update.sh
1 parent 0af2742 commit d0c36b1

File tree

3 files changed

+63
-47
lines changed

3 files changed

+63
-47
lines changed

16-master/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ RUN set -ex \
166166
&& rm -fr /usr/src/geos
167167

168168
# gdal
169-
ENV GDAL_GIT_HASH=ca7a2d38893a8d6cdc03653b47712f4442d99d65
169+
ENV GDAL_GIT_HASH=edcac5fc2ef9f42eb4a91cdc902820a58fb79d77
170170
RUN set -ex \
171171
&& cd /usr/src \
172172
&& git clone https://github.com/OSGeo/gdal.git \
@@ -303,7 +303,7 @@ ENV CGAL_GIT_HASH=b3e2f204a41c1e508a6f018454b60b00aa3dc6fd
303303
ENV SFCGAL_GIT_HASH=cc408a34af9c3443a2cfb0f559b778a54a3702ab
304304
ENV PROJ_GIT_HASH=6ef4961358a7525703c0f485b240582530f01b02
305305
ENV GEOS_GIT_HASH=16f53573f6bef38551801c2d449d4782775267bc
306-
ENV GDAL_GIT_HASH=ca7a2d38893a8d6cdc03653b47712f4442d99d65
306+
ENV GDAL_GIT_HASH=edcac5fc2ef9f42eb4a91cdc902820a58fb79d77
307307

308308
# Minimal command line test ( fail fast )
309309
RUN set -ex \
@@ -322,7 +322,7 @@ RUN set -ex \
322322
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1
323323

324324
# install postgis
325-
ENV POSTGIS_GIT_HASH=598acb6241df31b6f77f115b7af796e1226424ab
325+
ENV POSTGIS_GIT_HASH=9e3d207534699a2d43608b1f51c00780883126a1
326326

327327
RUN set -ex \
328328
&& apt-get update \

17-master/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ RUN set -ex \
166166
&& rm -fr /usr/src/geos
167167

168168
# gdal
169-
ENV GDAL_GIT_HASH=ca7a2d38893a8d6cdc03653b47712f4442d99d65
169+
ENV GDAL_GIT_HASH=edcac5fc2ef9f42eb4a91cdc902820a58fb79d77
170170
RUN set -ex \
171171
&& cd /usr/src \
172172
&& git clone https://github.com/OSGeo/gdal.git \
@@ -303,7 +303,7 @@ ENV CGAL_GIT_HASH=b3e2f204a41c1e508a6f018454b60b00aa3dc6fd
303303
ENV SFCGAL_GIT_HASH=cc408a34af9c3443a2cfb0f559b778a54a3702ab
304304
ENV PROJ_GIT_HASH=6ef4961358a7525703c0f485b240582530f01b02
305305
ENV GEOS_GIT_HASH=16f53573f6bef38551801c2d449d4782775267bc
306-
ENV GDAL_GIT_HASH=ca7a2d38893a8d6cdc03653b47712f4442d99d65
306+
ENV GDAL_GIT_HASH=edcac5fc2ef9f42eb4a91cdc902820a58fb79d77
307307

308308
# Minimal command line test ( fail fast )
309309
RUN set -ex \
@@ -322,7 +322,7 @@ RUN set -ex \
322322
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1
323323

324324
# install postgis
325-
ENV POSTGIS_GIT_HASH=598acb6241df31b6f77f115b7af796e1226424ab
325+
ENV POSTGIS_GIT_HASH=9e3d207534699a2d43608b1f51c00780883126a1
326326

327327
RUN set -ex \
328328
&& apt-get update \

README.md

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
[![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)
44

5-
The `postgis/postgis` image provides tags for running Postgres with [PostGIS](http://postgis.net/) extensions installed. This image is based on the official [`postgres`](https://registry.hub.docker.com/_/postgres/) image and provides debian and alpine variants for PostGIS 3.5.x and 3.6.x, which is compatible with PostgreSQL versions 13, 14, 15, 16, 17 and 18. Additionally, image variants are provided for PostgreSQL 16 and 17, built with PostGIS (and its dependencies) from their respective master branches. These are tagged as `16-master` and `17-master`.
5+
**⚠️ Breaking change (PostgreSQL 18+):**
6+
Default `VOLUME` path changed to `/var/lib/postgresql`
67

7-
> [!CAUTION]
8-
> ### Breaking Changes
9-
> * **PostgreSQL / PostGIS 18+**: the default `VOLUME` path changed to `/var/lib/postgresql`
8+
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 3.5.x and 3.6.x that are compatible with PostgreSQL versions 13, 14, 15, 16, 17 and 18. Additionally, image variants are provided for PostgreSQL 16 and 17, built with PostGIS (and its dependencies) from their respective master branches. These are tagged as `16-master` and `17-master`.
109

1110
This image ensures that the default database created by the parent `postgres` image will have the following extensions installed:
1211

@@ -15,32 +14,35 @@ This image ensures that the default database created by the parent `postgres` im
1514
| `postgis` | yes |
1615
| `postgis_topology` | yes |
1716
| `postgis_tiger_geocoder` | yes |
18-
| `postgis_raster` | |
19-
| `postgis_sfcgal` | |
20-
| `address_standardizer`| |
21-
| `address_standardizer_data_us`| |
17+
| `postgis_raster` | no (available) |
18+
| `postgis_sfcgal` | no (available) |
19+
| `address_standardizer`| no (available) |
20+
| `address_standardizer_data_us`| no (available) |
2221

2322
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`.
2423

25-
## Versions (2025-10-08)
24+
## Versions (2025-10-09)
2625

27-
Supported architecture: `amd64` (also known as X86-64)"
26+
Supported architecture: `amd64` (x86-64)
2827

2928
Recommended versions for new users are:
3029

31-
* `postgis/postgis:18-3.6` - ⚠️ **VOLUME path changed to `/var/lib/postgresql` in PostgreSQL 18+**
30+
* `postgis/postgis:18-3.6`
31+
* ⚠️ Uses `VOLUME` path `/var/lib/postgresql` (changed in PostgreSQL 18+)
32+
* `postgis/postgis:17-3.5`
33+
* Uses legacy `VOLUME` path `/var/lib/postgresql/data`
3234

3335
### Debian based (recommended)
3436

35-
* This Docker-PostGIS version has a cautious release cycle to guarantee high stability.
37+
* This Docker-PostGIS image has a cautious release cycle to guarantee high stability.
3638
* By "cautious", we mean it does not always have the latest versions of geos, proj, gdal, and sfcgal packages.
3739
* We use PostGIS, geos, proj, gdal, and sfcgal packages from the Debian repository.
38-
* In the Debian Bullseye repository (for PostgreSQL13 to 17), the versions are:
40+
* In the Debian Bullseye repository (for PostgreSQL 13 to 17), the versions are:
3941
* geos=3.9
4042
* gdal=3.2
4143
* proj=7.2
4244
* sfcgal=1.3.9
43-
* In the Debian trixie repository (for PostgreSQL18+), the versions are:
45+
* In the Debian Trixie repository (for PostgreSQL 18+), the versions are:
4446
* geos=3.13
4547
* gdal=3.10
4648
* proj=9.6
@@ -137,27 +139,39 @@ Since the docker-postgis repository is an extension of the official Docker Postg
137139
* `POSTGRES_INITDB_ARGS`
138140
* `POSTGRES_INITDB_WALDIR`
139141
* `POSTGRES_HOST_AUTH_METHOD`
140-
* `PGDATA` : [⚠️ Changed in Docker PostgreSQL 18 ! ⚠️ ](https://github.com/docker-library/docs/blob/master/postgres/README.md#pgdata )
141-
142-
> [!IMPORTANT]
143-
> ### `PGDATA` Volume Path Change
144-
>
145-
> The data directory (`VOLUME`) location has changed in **PostgreSQL 18 and later**,
146-
> which affects all corresponding **`postgis/postgis:18-*`** images.
147-
>
148-
> * **PostgreSQL / PostGIS 18+**`/var/lib/postgresql`
149-
> * **PostgreSQL / PostGIS 13–17**`/var/lib/postgresql/data`
150-
>
151-
> Please adjust your volume mounts accordingly when upgrading to `postgis/postgis:18-*` or newer.
152-
>
153-
> For more details, see [this upstream change](https://github.com/docker-library/postgres/pull/1259).
154-
142+
* `PGDATA` [⚠️ Changed in Docker PostgreSQL >=18 ! ⚠️ ](https://github.com/docker-library/docs/blob/master/postgres/README.md#pgdata )
155143

156144
Read more in the [docker-postgres README page](https://github.com/docker-library/docs/blob/master/postgres/README.md)
157145

158-
Warning: **the Docker specific variables will only have an effect if you start the container with a data directory that is empty;** any pre-existing database will be left untouched on container startup.
159146

160-
It's important to note that the environment variables for the Docker image are different from those of the [libpq — C Library](https://www.postgresql.org/docs/current/libpq-envars.html) (`PGDATABASE`,`PGUSER`,`PGPASSWORD` )
147+
### ⚠️ `PGDATA` Volume Path Change
148+
149+
Starting from **PostgreSQL 18**, the default data directory (`VOLUME`) path has changed.
150+
This affects all corresponding **`postgis/postgis:18-*`** and newer images.
151+
152+
**Summary of volume paths:**
153+
154+
| Image name | Image tag range | `--volume` path |
155+
|-------------|-----------------|-----------------|
156+
| `postgis/postgis` | `18-*`| `/var/lib/postgresql` |
157+
| `postgis/postgis` | `13-*``17-*` | `/var/lib/postgresql/data` |
158+
159+
Please adjust your volume mounts for 18+ images.
160+
For more details, see the [upstream change](https://github.com/docker-library/postgres/pull/1259).
161+
162+
### Initialize Only on Empty Data Directory
163+
164+
Docker-specific environment variables (for example, `POSTGRES_DB`, `POSTGRES_USER`, `POSTGRES_PASSWORD`)
165+
take effect **only when the container is started with an empty data directory**.
166+
Any pre-existing database will be left **untouched** on container startup.
167+
168+
If you need to re-initialize or change settings, make sure to remove or re-create the volume first.
169+
170+
### `libpq` Environment Variables
171+
172+
Please note that Docker environment variables are **different** from those used by the
173+
[libpq — C Library](https://www.postgresql.org/docs/current/libpq-envars.html).
174+
These include: `PGDATABASE`, `PGUSER`, `PGPASSWORD`, and others used by client tools.
161175

162176
## Troubleshooting tips
163177

@@ -169,10 +183,10 @@ Troubleshooting can often be challenging. It's important to know that the docker
169183
* Docker Community Slack: https://dockr.ly/slack
170184
* Stack Overflow: https://stackoverflow.com/questions/tagged/docker+postgresql
171185

172-
If your problem is Postgis related:
186+
If your problem is PostGIS related:
173187

174188
* Stack Overflow : docker + postgis https://stackoverflow.com/questions/tagged/docker+postgis
175-
* Postgis issue tracker: https://trac.osgeo.org/postgis/report
189+
* PostGIS issue tracker: https://trac.osgeo.org/postgis/report
176190

177191
And if you don't have a postgres docker experience - read this blog post:
178192

@@ -184,9 +198,10 @@ It's crucial to be aware that in a cloud environment, with default settings, the
184198

185199
* Note that ports which are not bound to the host (i.e., `-p 5432:5432` instead of `-p 127.0.0.1:5432:5432`) will be accessible from the outside. This also applies if you configured UFW to block this specific port, as Docker manages its own iptables rules. ( [Read More](https://docs.docker.com/network/iptables/) )
186200

187-
#### io_uring
188-
Every `postgis/postgis:18*` image includes **`io_uring` capabilities** for asynchronous I/O. However, some container runtimes (for example, [containerd](https://github.com/containerd/containerd/issues/9048)) have **disabled `io_uring` support** in the past due to **security concerns**.
189-
If you wish to experiment with this feature, please do so **at your own risk**, and only **after explicitly enabling `io_uring` in your [seccomp profile](https://docs.docker.com/engine/security/seccomp/)**.
201+
### io_uring
202+
203+
Every `postgis/postgis:18-*` image includes `io_uring` capabilities for asynchronous I/O. However, some container runtimes (for example, [containerd](https://github.com/containerd/containerd/issues/9048)) have **disabled `io_uring` support** in the past due to **security concerns**.
204+
If you wish to experiment with this feature, please do so **at your own risk**, and only after explicitly enabling `io_uring` in your [seccomp profile](https://docs.docker.com/engine/security/seccomp/).
190205

191206
### Recommendations
192207

@@ -196,9 +211,9 @@ If you wish to experiment with this feature, please do so **at your own risk**,
196211

197212
### Security scanner information
198213

199-
* Please also scan the base `postgres` docker Image:
200-
It's important to also scan the base `postgres` Docker image for potential security issues. If your security scanner reports vulnerabilities (known as CVEs) in the image, you may wonder why. To get a better understanding, please read the Docker Library FAQ, especially the section titled ["Why does my security scanner show that an image has CVEs?"](https://github.com/docker-library/faq#why-does-my-security-scanner-show-that-an-image-has-cves)
201-
For more specific issues related to the postgres docker image, you can search using these links:
214+
* Please also scan the base `postgres` Docker image for potential security issues.
215+
If your security scanner reports vulnerabilities (CVEs), check the [Docker Library FAQ](https://github.com/docker-library/faq#why-does-my-security-scanner-show-that-an-image-has-cves) — especially the section *“Why does my security scanner show that an image has CVEs?”*
216+
For more specific issues related to the Postgres Docker image, you can search using these links:
202217
* [search for repo:docker-library/postgres trivy](https://github.com/search?q=repo%3Adocker-library%2Fpostgres+trivy&type=issues)
203218
* [search for repo:docker-library/postgres CVE](https://github.com/search?q=repo%3Adocker-library%2Fpostgres+CVE&type=issues)
204219

@@ -221,11 +236,11 @@ We are always open to suggestions to enhance security. If you have any ideas, pl
221236

222237
## Known Issues / Errors
223238

224-
When You encounter errors due to PostGIS update `OperationalError: could not access file "$libdir/postgis-X.X`, run:
239+
When you encounter errors due to PostGIS update `OperationalError: could not access file "$libdir/postgis-X.X`, run:
225240

226241
`docker exec some-postgis update-postgis.sh`
227242

228-
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:
243+
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 a notification like:
229244

230245
```log
231246
Updating PostGIS extensions template_postgis to X.X.X
@@ -247,6 +262,7 @@ This Docker-PostGIS project [is part of the PostGIS group](https://postgis.net/d
247262
* Please take a moment to review the current issues, discussions, and pull requests before you start.
248263
* If you have a major change in mind, we kindly ask you to start a discussion about it first.
249264
* After making changes to the templates, please run the `./update.sh` script.
265+
* The `README.md` must be written in plain and platform-compatible Markdown that renders correctly on both GitHub and [Docker Hub](https://hub.docker.com/r/postgis/postgis).
250266

251267
## Code of Conduct
252268

0 commit comments

Comments
 (0)