From 2b17a081d9e3f3807c98d28b00129f1f2d470795 Mon Sep 17 00:00:00 2001 From: Andrew Olsen Date: Mon, 17 Jun 2024 19:34:51 +1200 Subject: [PATCH] Build geoserver.war from vendor/geoserver don't download a war.zip from anywhere --- .gitmodules | 3 +++ Dockerfile | 8 ++++---- KOORDINATES.md | 21 +++++++++++++++++++++ README.md | 3 +++ vendor/geoserver | 1 + 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 100644 KOORDINATES.md create mode 160000 vendor/geoserver diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..197f5ab --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/geoserver"] + path = vendor/geoserver + url = git@github.com:koordinates/geoserver-plus-kx.git diff --git a/Dockerfile b/Dockerfile index bdeb81c..78de58c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,15 +58,15 @@ FROM tomcat as download ARG GS_VERSION=2.25.1 ARG GS_BUILD=release -ARG WAR_ZIP_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GS_VERSION}/geoserver-${GS_VERSION}-war.zip +ARG WAR_FILE=vendor/geoserver/src/web/app/target/geoserver.war ENV GEOSERVER_VERSION=$GS_VERSION ENV GEOSERVER_BUILD=$GS_BUILD WORKDIR /tmp -RUN echo "Downloading GeoServer ${GS_VERSION} ${GS_BUILD}" \ - && wget -q -O /tmp/geoserver.zip $WAR_ZIP_URL \ - && unzip geoserver.zip geoserver.war -d /tmp/ \ +COPY ${WAR_FILE} /tmp/geoserver.war + +RUN echo "Extracting /tmp/geoserver.war (from ${WAR_FILE})" \ && unzip -q /tmp/geoserver.war -d /tmp/geoserver \ && rm /tmp/geoserver.war diff --git a/KOORDINATES.md b/KOORDINATES.md new file mode 100644 index 0000000..d59f9e0 --- /dev/null +++ b/KOORDINATES.md @@ -0,0 +1,21 @@ +# Build geoserver.war +(at `vendor/geoserver/src/web/app/target/geoserver.war`): + +```shell +mvn clean install -f vendor/geoserver/src -Dmaven.test.skip=true +``` + +(tests are currently failing due to koordinates-applicationContext.xml) + +# Build docker image + +```shell +docker build -t {YOUR_TAG} . +``` + +# Run + +```shell +docker run -it -p 80:8080 {YOUR_TAG} +``` + diff --git a/README.md b/README.md index 37fe1ec..7a1fff7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +> [!IMPORTANT] +> This README.md file covers official geoserver builds. See [KOORDINATES.md](KOORDINATES.md) + # A geoserver docker image This Dockerfile can be used to create images for all geoserver versions since 2.5. diff --git a/vendor/geoserver b/vendor/geoserver new file mode 160000 index 0000000..672e38c --- /dev/null +++ b/vendor/geoserver @@ -0,0 +1 @@ +Subproject commit 672e38c3e741f296f9e2c46a97884827fcca3ab3