From 677fb88ea94312f133e1771ccc45b3e9f5b226ee Mon Sep 17 00:00:00 2001 From: Jose Macchi Date: Tue, 1 Oct 2024 09:15:29 -0300 Subject: [PATCH] GDAL base docker image Update src/apps/base-images/gdal/Dockerfile Co-authored-by: Daniel Koch --- src/apps/base-images/gdal/Dockerfile | 28 ++++++++++++++++++++++++++++ src/apps/base-images/gdal/pom.xml | 24 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/apps/base-images/gdal/Dockerfile create mode 100644 src/apps/base-images/gdal/pom.xml diff --git a/src/apps/base-images/gdal/Dockerfile b/src/apps/base-images/gdal/Dockerfile new file mode 100644 index 000000000..c423e5bdd --- /dev/null +++ b/src/apps/base-images/gdal/Dockerfile @@ -0,0 +1,28 @@ +#FROM geoservercloud/gs-cloud-base-jre:$TAG as builder +FROM eclipse-temurin:11-jdk as builder + +LABEL maintainer="GeoServer PSC " + +ENV GDAL_VERSION 3.8.4 +ENV GDAL_PATH /usr/share/gdal +ENV GDAL_DATA $GDAL_PATH/3.8.4 +ENV PATH $GDAL_PATH:$PATH +ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/jni:/usr/share/java:/usr/local/lib/:/usr/lib/ + +# +# GDAL INSTALLATION +# +# Manual compilation - https://stackoverflow.com/questions/76913667/unable-to-locate-package-libgdal-java +RUN apt update && apt-get install -y wget build-essential libuv1-dev g++ libstdc++6 make linux-headers-generic \ + libssl-dev swig zlib1g-dev proj-bin proj-data libproj-dev sqlite3 libsqlite3-dev \ + libtiff-dev libcurl4-openssl-dev cmake libcrypto++-dev ant libeccodes-dev libnetcdf-dev +# Install GDAL +RUN wget https://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz -O /tmp/gdal.tar.gz && \ + tar xzf /tmp/gdal.tar.gz -C /tmp && \ + cd /tmp/gdal-${GDAL_VERSION} && \ + sed -i 's/source="7"/source="8"/' /tmp/gdal-${GDAL_VERSION}/swig/java/build.xml && \ + sed -i 's/target="7"/target="8"/' /tmp/gdal-${GDAL_VERSION}/swig/java/build.xml +RUN cd /tmp/gdal-${GDAL_VERSION} && mkdir build && cd build && cmake .. && cmake --build . && cmake --build . --target install + +RUN cp /tmp/gdal-3.8.4/build/swig/java/gdal.jar /tmp/gdal.jar +RUN cp /tmp/gdal-3.8.4/build/swig/java/libgdalalljni.so /tmp/libgdalalljni.so diff --git a/src/apps/base-images/gdal/pom.xml b/src/apps/base-images/gdal/pom.xml new file mode 100644 index 000000000..d2ee3828b --- /dev/null +++ b/src/apps/base-images/gdal/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + org.geoserver.cloud.apps + gs-cloud-base-images + ${revision} + + gs-cloud-base-jre-gdal + jar + Base GDAL image + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + true + + + + +