-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build the GDAL base image and the geoserver images on top of it
- Loading branch information
Showing
19 changed files
with
136 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,55 @@ | ||
services: | ||
base-image-jre: | ||
# Base JRE image, ubuntu 24.04, jre 21 temurin | ||
jre: | ||
extends: | ||
file: templates.yml | ||
service: multi-platform | ||
image: ${REPOSITORY}/gs-cloud-base-jre:${TAG} | ||
image: ${REPOSITORY}/jre:21-tem | ||
build: | ||
context: ../src/apps/base-images/jre/ | ||
|
||
base-image-spring-boot: | ||
# Base JRE image with libgdal-java | ||
jre-gdal: | ||
extends: | ||
file: templates.yml | ||
service: multi-platform | ||
image: ${REPOSITORY}/gs-cloud-base-spring-boot:${TAG} | ||
depends_on: [base-image-jre] | ||
image: ${REPOSITORY}/jre-gdal:21-3.8.4 | ||
depends_on: [jre] | ||
build: | ||
context: ../src/apps/base-images/gdal/ | ||
args: | ||
JRE_BASE_IMAGE_NAME: jre:21-tem | ||
|
||
# Base JRE + Spring Boot common layer for infra services | ||
spring-boot-common: | ||
extends: | ||
file: templates.yml | ||
service: multi-platform | ||
image: ${REPOSITORY}/spring-boot-common:${TAG} | ||
depends_on: [jre] | ||
build: | ||
context: ../src/apps/base-images/spring-boot/ | ||
args: | ||
JRE_BASE_IMAGE_NAME: jre:21-tem | ||
|
||
# Base JRE + GDAL + Spring Boot common layer for GeoServer services | ||
spring-boot-common-gdal: | ||
extends: | ||
file: templates.yml | ||
service: multi-platform | ||
image: ${REPOSITORY}/spring-boot-common-gdal:${TAG} | ||
depends_on: [jre-gdal] | ||
build: | ||
context: ../src/apps/base-images/spring-boot/ | ||
args: | ||
JRE_BASE_IMAGE_NAME: jre-gdal:21-3.8.4 | ||
|
||
base-image-geoserver: | ||
# Base JRE + GDAL + Spring Boot + shared GeoServer dependencies layer for GeoServer services | ||
geoserver-common: | ||
extends: | ||
file: templates.yml | ||
service: multi-platform | ||
image: ${REPOSITORY}/gs-cloud-base-geoserver-image:${TAG} | ||
depends_on: [base-image-spring-boot] | ||
image: ${REPOSITORY}/geoserver-common:${TAG} | ||
depends_on: [spring-boot-common-gdal] | ||
build: | ||
context: ../src/apps/base-images/geoserver/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,55 @@ | ||
services: | ||
base-image-jre: | ||
# Base JRE image, ubuntu 24.04, jre 21 temurin | ||
jre: | ||
extends: | ||
file: templates.yml | ||
service: current-platform | ||
image: ${REPOSITORY}/gs-cloud-base-jre:${TAG} | ||
image: ${REPOSITORY}/jre:21-tem | ||
build: | ||
context: ../src/apps/base-images/jre/ | ||
|
||
base-image-spring-boot: | ||
# Base JRE image with libgdal-java | ||
jre-gdal: | ||
extends: | ||
file: templates.yml | ||
service: current-platform | ||
image: ${REPOSITORY}/gs-cloud-base-spring-boot:${TAG} | ||
depends_on: [base-image-jre] | ||
image: ${REPOSITORY}/jre-gdal:21-3.8.4 | ||
depends_on: [jre] | ||
build: | ||
context: ../src/apps/base-images/gdal/ | ||
args: | ||
JRE_BASE_IMAGE_NAME: jre:21-tem | ||
|
||
# Base JRE + Spring Boot common layer for infra services | ||
spring-boot-common: | ||
extends: | ||
file: templates.yml | ||
service: current-platform | ||
image: ${REPOSITORY}/spring-boot-common:${TAG} | ||
depends_on: [jre] | ||
build: | ||
context: ../src/apps/base-images/spring-boot/ | ||
args: | ||
JRE_BASE_IMAGE_NAME: jre:21-tem | ||
|
||
# Base JRE + GDAL + Spring Boot common layer for GeoServer services | ||
spring-boot-common-gdal: | ||
extends: | ||
file: templates.yml | ||
service: current-platform | ||
image: ${REPOSITORY}/spring-boot-common-gdal:${TAG} | ||
depends_on: [jre-gdal] | ||
build: | ||
context: ../src/apps/base-images/spring-boot/ | ||
args: | ||
JRE_BASE_IMAGE_NAME: jre-gdal:21-3.8.4 | ||
|
||
base-image-geoserver: | ||
# Base JRE + GDAL + Spring Boot + shared GeoServer dependencies layer for GeoServer services | ||
geoserver-common: | ||
extends: | ||
file: templates.yml | ||
service: current-platform | ||
image: ${REPOSITORY}/gs-cloud-base-geoserver-image:${TAG} | ||
depends_on: [base-image-spring-boot] | ||
image: ${REPOSITORY}/geoserver-common:${TAG} | ||
depends_on: [spring-boot-common-gdal] | ||
build: | ||
context: ../src/apps/base-images/geoserver/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#FROM geoservercloud/gs-cloud-base-jre:$TAG as builder | ||
FROM eclipse-temurin:11-jdk as builder | ||
ARG REPOSITORY=geoservercloud | ||
ARG JRE_BASE_IMAGE_NAME=jre:21-tem | ||
ARG TAG=latest | ||
|
||
LABEL maintainer="GeoServer PSC <[email protected]>" | ||
# Build with java 11 | ||
FROM eclipse-temurin:11-jdk as builder | ||
|
||
ENV GDAL_VERSION 3.8.4 | ||
ENV GDAL_PATH /usr/share/gdal | ||
|
@@ -24,5 +26,21 @@ RUN wget https://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.ta | |
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 | ||
RUN mkdir /tmp/gdal-java | ||
RUN cp /tmp/gdal-3.8.4/build/swig/java/gdal.jar /tmp/gdal-java/gdal.jar | ||
RUN cp /tmp/gdal-3.8.4/build/swig/java/libgdalalljni.so /tmp/gdal-java/libgdalalljni.so | ||
|
||
########## | ||
FROM $REPOSITORY/$JRE_BASE_IMAGE_NAME | ||
|
||
ENV GDAL_PATH /usr/share/gdal | ||
ENV GDAL_DATA $GDAL_PATH | ||
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$GDAL_PATH/lib:/usr/local/lib/:/usr/lib/ | ||
|
||
# see https://docs.docker.com/build/cache/optimize/#use-cache-mounts | ||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
apt update && apt-get --no-install-recommends install -y gdal-bin \ | ||
&& mkdir $GDAL_PATH/lib | ||
|
||
COPY --from=builder /tmp/gdal-java/* $GDAL_PATH/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM eclipse-temurin:21-jre | ||
# JRE 21 on Ubuntu 24.04 | ||
FROM eclipse-temurin:21-jre-noble | ||
|
||
LABEL maintainer="GeoServer PSC <[email protected]>" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.