Skip to content

Commit afae81a

Browse files
committed
chore: simplify common structure
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent e62e4dc commit afae81a

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

docker-bake.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ target "default" {
5656
args = {
5757
PG_MAJOR = "${pgVersion}"
5858
EXT_VERSION = "${getExtensionPackage(distro, pgVersion)}"
59-
EXT_MAJOR = "${metadata.major_version}"
6059
BASE = "${getBaseImage(distro, pgVersion)}"
6160
}
6261

pgvector/metadata.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ metadata = {
66
extension_control_path = []
77
dynamic_library_path = []
88
ld_library_path = []
9-
major_version = null
109

1110
versions = {
1211
bookworm = {

postgis/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM $BASE AS builder
33

44
ARG PG_MAJOR
55
ARG EXT_VERSION
6-
ARG EXT_MAJOR
6+
ARG POSTGIS_MAJOR
77
ARG PG_ROUTING_VERSION
88

99
USER 0
@@ -14,7 +14,7 @@ RUN set -eux && \
1414
# Install PostGIS
1515
apt-get update && \
1616
apt-get install -y --no-install-recommends \
17-
"postgresql-${PG_MAJOR}-postgis-${EXT_MAJOR}=${EXT_VERSION}" \
17+
"postgresql-${PG_MAJOR}-postgis-${POSTGIS_MAJOR}=${EXT_VERSION}" \
1818
"postgresql-${PG_MAJOR}-pgrouting=${PG_ROUTING_VERSION}"
1919

2020
# Gather PostGIS system libraries and their licenses
@@ -44,19 +44,20 @@ RUN mkdir -p /system /licenses && \
4444
# Get licenses
4545
for lib in $(find /system -maxdepth 1 -type f -name '*.so*'); do \
4646
# Get the name of the pkg that installed the library
47-
pkg=$(dpkg -S "$(basename "$lib")" | awk -F: '/:/{print $1; exit}'); \
47+
pkg=$(dpkg -S "$(basename "$lib")" | grep -v "diversion by" | awk -F: '/:/{print $1; exit}'); \
48+
echo "$lib: $pkg"; \
4849
[ -z "$pkg" ] && continue; \
4950
mkdir -p "/licenses/$pkg" && cp -a "/usr/share/doc/$pkg/copyright" "/licenses/$pkg/copyright"; \
5051
done
5152

5253

5354
FROM scratch
5455
ARG PG_MAJOR
55-
ARG EXT_MAJOR
56+
ARG POSTGIS_MAJOR
5657

5758
# Licenses
5859
COPY --from=builder /licenses /licenses/
59-
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}-postgis-${POSTGIS_MAJOR}/copyright /licenses/postgresql-${PG_MAJOR}-postgis-${POSTGIS_MAJOR}/
6061
COPY --from=builder /usr/share/doc/postgresql-${PG_MAJOR}-pgrouting/copyright /licenses/postgresql-${PG_MAJOR}-pgrouting/
6162

6263
# Libraries

postgis/metadata.hcl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ metadata = {
66
extension_control_path = []
77
dynamic_library_path = []
88
ld_library_path = ["/system"]
9-
major_version = "3"
109

1110
versions = {
1211
bookworm = {
@@ -18,16 +17,16 @@ metadata = {
1817
"18" = "3.6.1+dfsg-1.pgdg13+1"
1918
}
2019
}
20+
}
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-
}
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"
3130
}
3231
}
3332

@@ -39,6 +38,7 @@ target "default" {
3938
}
4039

4140
args = {
42-
PG_ROUTING_VERSION = metadata.pgRouting[distro][pgVersion]
41+
PG_ROUTING_VERSION = pgRouting[distro][pgVersion]
42+
POSTGIS_MAJOR = "3"
4343
}
4444
}

0 commit comments

Comments
 (0)