Skip to content

Commit

Permalink
GDAL base docker image
Browse files Browse the repository at this point in the history
Update src/apps/base-images/gdal/Dockerfile

Co-authored-by: Daniel Koch <[email protected]>
  • Loading branch information
jemacchi and dnlkoch committed Oct 1, 2024
1 parent cd03d92 commit 451c3d3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/apps/base-images/gdal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#FROM geoservercloud/gs-cloud-base-jre:$TAG as builder
FROM eclipse-temurin:11-jdk as builder

LABEL maintainer="GeoServer PSC <[email protected]>"

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
24 changes: 24 additions & 0 deletions src/apps/base-images/gdal/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geoserver.cloud.apps</groupId>
<artifactId>gs-cloud-base-images</artifactId>
<version>${revision}</version>
</parent>
<artifactId>gs-cloud-base-jre-gdal</artifactId>
<packaging>jar</packaging>
<name>Base GDAL image</name>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 451c3d3

Please sign in to comment.