Skip to content

Commit e8fc64b

Browse files
committed
feat: drop pgrouting
It should be distributed on its own, we shouldn't load the postgis image with dependencies. Signed-off-by: Francesco Canovai <[email protected]>
1 parent c3e4bd5 commit e8fc64b

File tree

6 files changed

+3
-27
lines changed

6 files changed

+3
-27
lines changed

postgis/Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ FROM $BASE AS builder
44
ARG PG_MAJOR
55
ARG EXT_VERSION
66
ARG POSTGIS_MAJOR
7-
ARG PG_ROUTING_VERSION
87

98
USER 0
109

@@ -14,15 +13,13 @@ RUN set -eux && \
1413
# Install PostGIS
1514
apt-get update && \
1615
apt-get install -y --no-install-recommends \
17-
"postgresql-${PG_MAJOR}-postgis-${POSTGIS_MAJOR}=${EXT_VERSION}" \
18-
"postgresql-${PG_MAJOR}-pgrouting=${PG_ROUTING_VERSION}"
16+
"postgresql-${PG_MAJOR}-postgis-${POSTGIS_MAJOR}=${EXT_VERSION}"
1917

2018
# Gather PostGIS system libraries and their licenses
2119
RUN mkdir -p /system /licenses && \
2220
# Get libraries
2321
ldd /usr/lib/postgresql/${PG_MAJOR}/lib/address_standardizer*.so \
2422
/usr/lib/postgresql/${PG_MAJOR}/lib/postgis*.so \
25-
/usr/lib/postgresql/${PG_MAJOR}/lib/libpgrouting*.so \
2623
| awk '{print $3}' | grep '^/' | sort | uniq > /tmp/all-deps.out && \
2724
# Extract all the libs that aren't already part of the base image
2825
comm -13 /tmp/base-image-libs.out /tmp/all-deps.out > /tmp/libraries.out && \
@@ -57,13 +54,11 @@ ARG POSTGIS_MAJOR
5754
# Licenses
5855
COPY --from=builder /licenses /licenses/
5956
COPY --from=builder /usr/share/doc/postgresql-${PG_MAJOR}-postgis-${POSTGIS_MAJOR}/copyright /licenses/postgresql-${PG_MAJOR}-postgis-${POSTGIS_MAJOR}/
60-
COPY --from=builder /usr/share/doc/postgresql-${PG_MAJOR}-pgrouting/copyright /licenses/postgresql-${PG_MAJOR}-pgrouting/
6157

6258
# Libraries
6359
COPY --from=builder \
6460
/usr/lib/postgresql/${PG_MAJOR}/lib/address_standardizer* \
6561
/usr/lib/postgresql/${PG_MAJOR}/lib/postgis* \
66-
/usr/lib/postgresql/${PG_MAJOR}/lib/libpgrouting* \
6762
/lib/
6863

6964
COPY --from=builder /usr/lib/postgresql/18/lib/bitcode/ /lib/bitcode/
@@ -72,7 +67,6 @@ COPY --from=builder /usr/lib/postgresql/18/lib/bitcode/ /lib/bitcode/
7267
COPY --from=builder \
7368
/usr/share/postgresql/${PG_MAJOR}/extension/address_standardizer* \
7469
/usr/share/postgresql/${PG_MAJOR}/extension/postgis* \
75-
/usr/share/postgresql/${PG_MAJOR}/extension/pgrouting* \
7670
/share/extension/
7771

7872
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/contrib/postgis* /share/contrib/

postgis/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
This image provides a convenient way to deploy and manage `PostGIS` with
66
[CloudNativePG](https://cloudnative-pg.io/).
7-
It also packages [pgRouting](https://github.com/pgRouting/pgrouting).
87

98
## Usage
109

@@ -58,7 +57,6 @@ spec:
5857
- name: address_standardizer_data_us
5958
- name: postgis_tiger_geocoder
6059
- name: postgis_topology
61-
- name: pgrouting
6260
```
6361

6462
### 3. Verify installation
@@ -72,7 +70,7 @@ Once the database is ready, connect to it with `psql` and run:
7270
You should see `postgis`, `postgis_raster` (and so on) listed among the installed extensions.
7371

7472

75-
### 4. Verify OS dependencies are properly satisified
73+
### 4. Verify OS dependencies are properly satisfied
7674

7775
PostGIS requires several OS dependencies that are being provided via the `/system` directory.
7876
CloudNativePG makes them available to PostgreSQL by adding the directory to LD_LIBRARY_PATH for the PostgreSQL process.
@@ -82,7 +80,7 @@ connect to the container and run:
8280

8381
```bash
8482
cd /extensions/postgis/lib
85-
LD_LIBRARY_PATH=/extensions/postgis/system ldd address_standardizer* postgis* libpgrouting*
83+
LD_LIBRARY_PATH=/extensions/postgis/system ldd address_standardizer* postgis*
8684
```
8785

8886
Make sure there are no missing shared libraries.

postgis/metadata.hcl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@ metadata = {
1919
}
2020
}
2121

22-
pgRouting = {
23-
bookworm = {
24-
// renovate: suite=bookworm-pgdg depName=postgresql-18-pgrouting
25-
"18" = "4.0.0-1.pgdg12+1"
26-
}
27-
trixie = {
28-
// renovate: suite=trixie-pgdg depName=postgresql-18-pgrouting
29-
"18" = "4.0.0-1.pgdg13+1"
30-
}
31-
}
32-
3322
target "default" {
3423
name = "${metadata.name}-${sanitize(getExtensionVersion(distro, pgVersion))}-${pgVersion}-${distro}"
3524
matrix = {
@@ -38,7 +27,6 @@ target "default" {
3827
}
3928

4029
args = {
41-
PG_ROUTING_VERSION = pgRouting[distro][pgVersion]
4230
POSTGIS_MAJOR = "3"
4331
}
4432
}

postgis/test/check-extension.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ spec:
2828
test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'address_standardizer_data_us')" -q)" = "t"
2929
test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis_tiger_geocoder')" -q)" = "t"
3030
test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'postgis_topology')" -q)" = "t"
31-
test "$(psql "$DB_URI" -tAc "SELECT EXISTS (SELECT FROM pg_catalog.pg_extension WHERE extname = 'pgrouting')" -q)" = "t"

postgis/test/database-assert.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ status:
2121
name: postgis_tiger_geocoder
2222
- applied: true
2323
name: postgis_topology
24-
- applied: true
25-
name: pgrouting
2624
observedGeneration: 1

postgis/test/database.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ spec:
1616
- name: address_standardizer_data_us
1717
- name: postgis_tiger_geocoder
1818
- name: postgis_topology
19-
- name: pgrouting

0 commit comments

Comments
 (0)