Skip to content

Commit 03ca47c

Browse files
committed
fix(PostGIS): define GDAL/PROJ datasets
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent 93c77f4 commit 03ca47c

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

postgis/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ COPY --from=builder \
6161
/usr/lib/postgresql/${PG_MAJOR}/lib/postgis* \
6262
/lib/
6363

64-
COPY --from=builder /usr/lib/postgresql/18/lib/bitcode/ /lib/bitcode/
64+
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/ /lib/bitcode/
6565

6666
# Share
6767
COPY --from=builder \
@@ -74,4 +74,8 @@ COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/contrib/postgis* /share/co
7474
# System libs
7575
COPY --from=builder /system /system/
7676

77+
# Geospatial datasets
78+
COPY --from=builder /usr/share/gdal /system/share/gdal
79+
COPY --from=builder /usr/share/proj /system/share/proj
80+
7781
USER 65532:65532

postgis/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ spec:
3232
reference: ghcr.io/cloudnative-pg/postgis-extension:3.6.2-18-trixie
3333
ld_library_path:
3434
- system
35+
env:
36+
- name: GDAL_DATA
37+
value: ${image_root}/system/share/gdal
38+
- name: PROJ_DATA
39+
value: ${image_root}/system/share/proj
3540
```
3641
3742
### 2. Enable the extension in a database

postgis/metadata.hcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ metadata = {
99
dynamic_library_path = []
1010
ld_library_path = ["system"]
1111
bin_path = []
12-
env = {}
12+
env = {
13+
"GDAL_DATA" = "$${image_root}/system/share/gdal",
14+
"PROJ_DATA" = "$${image_root}/system/share/proj",
15+
}
1316
auto_update_os_libs = true
1417
required_extensions = []
1518
create_extension = true

0 commit comments

Comments
 (0)