Skip to content

Commit b4fe1dd

Browse files
committed
feat: pgrouting
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent 1a3f552 commit b4fe1dd

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

postgis/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM $BASE AS builder
44
ARG PG_MAJOR
55
ARG EXT_VERSION
66
ARG EXT_MAJOR
7+
ARG PG_ROUTING_VERSION
78

89
USER 0
910

@@ -12,13 +13,16 @@ RUN set -eux && \
1213
ldconfig -p | awk '{print $NF}' | grep '^/' | sort | uniq > /tmp/base-image-libs.out && \
1314
# Install PostGIS
1415
apt-get update && \
15-
apt-get install -y --no-install-recommends "postgresql-${PG_MAJOR}-postgis-${EXT_MAJOR}=${EXT_VERSION}"
16+
apt-get install -y --no-install-recommends \
17+
"postgresql-${PG_MAJOR}-postgis-${EXT_MAJOR}=${EXT_VERSION}" \
18+
"postgresql-${PG_MAJOR}-pgrouting=${PG_ROUTING_VERSION}"
1619

1720
# Gather PostGIS system libraries and their licenses
1821
RUN mkdir -p /system /licenses && \
1922
# Get libraries
2023
ldd /usr/lib/postgresql/${PG_MAJOR}/lib/address_standardizer*.so \
2124
/usr/lib/postgresql/${PG_MAJOR}/lib/postgis*.so \
25+
/usr/lib/postgresql/${PG_MAJOR}/lib/libpgrouting*.so \
2226
| awk '{print $3}' | grep '^/' | sort | uniq > /tmp/all-deps.out && \
2327
# Extract all the libs that aren't already part of the base image
2428
comm -13 /tmp/base-image-libs.out /tmp/all-deps.out > /tmp/libraries.out && \
@@ -53,6 +57,7 @@ ARG EXT_MAJOR
5357
# Licenses
5458
COPY --from=builder /licenses /licenses/
5559
COPY --from=builder /usr/share/doc/postgresql-${PG_MAJOR}-postgis-${EXT_MAJOR}/copyright /licenses/postgresql-${PG_MAJOR}-postgis-${EXT_MAJOR}/
60+
COPY --from=builder /usr/share/doc/postgresql-${PG_MAJOR}-pgrouting/copyright /licenses/postgresql-${PG_MAJOR}-pgrouting/
5661

5762
# Libraries
5863
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/address_standardizer* /usr/lib/postgresql/${PG_MAJOR}/lib/postgis* /lib/

postgis/metadata.hcl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,27 @@ metadata = {
1818
"18" = "3.6.1+dfsg-1.pgdg13+1"
1919
}
2020
}
21+
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+
}
33+
34+
target "default" {
35+
name = "${metadata.name}-${sanitize(getExtensionVersion(distro, pgVersion))}-${pgVersion}-${distro}"
36+
matrix = {
37+
pgVersion = pgVersions
38+
distro = distributions
39+
}
40+
41+
args = {
42+
PG_ROUTING_VERSION = metadata.pgRouting[distro][pgVersion]
43+
}
2144
}

0 commit comments

Comments
 (0)