diff --git a/Dockerfile b/Dockerfile index 7e4ba0f..2f6748d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM tomcat:jdk11-openjdk-slim +FROM tomcat:9.0.41-jdk11-openjdk-slim AS base -ARG GEOSERVER_VERSION=2.18.1 +ARG GEOSERVER_VERSION=2.18.2 -ARG WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GEOSERVER_VERSION}/geoserver-${GEOSERVER_VERSION}-war.zip +ARG GEOSERVER_WAR_SRC=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GEOSERVER_VERSION}/geoserver-${GEOSERVER_VERSION}-war.zip ARG STABLE_PLUGIN_URL=https://sourceforge.net/projects/geoserver/files/GeoServer/${GEOSERVER_VERSION}/extensions ARG CORS_ENABLED=false @@ -32,15 +32,15 @@ RUN apt update && \ apt install -y curl wget openssl zip fontconfig libfreetype6 && \ rm -rf ${CATALINA_HOME}/webapps/* +ADD "${GEOSERVER_WAR_SRC}" "/tmp/" + # install geoserver -RUN wget --progress=bar:force:noscroll -c --no-check-certificate "${WAR_URL}" -O /tmp/geoserver.zip && \ - unzip /tmp/geoserver.zip geoserver.war -d ${CATALINA_HOME}/webapps && \ - mkdir -p ${GEOSERVER_DIR} && \ - unzip -q ${CATALINA_HOME}/webapps/geoserver.war -d ${GEOSERVER_DIR} && \ +RUN unzip /tmp/geoserver*.zip geoserver.war -d ${CATALINA_HOME}/webapps && \ + mkdir -p ${GEOSERVER_DIR} && \unzip -q ${CATALINA_HOME}/webapps/geoserver.war -d ${GEOSERVER_DIR} && \ rm ${CATALINA_HOME}/webapps/geoserver.war # configure CORS (inspired by https://github.com/oscarfonts/docker-geoserver) -RUN if [ "$CORS_ENABLED" = "true" ]; then \ +RUN if [ "${CORS_ENABLED}" = "true" ]; then \ sed -i "\::i\ \ \n\ \ CorsFilter\n\ \ diff --git a/README.md b/README.md index a2a97f8..6f4441e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,10 @@ Work is still in progress! 1. The [Dockerfile](Dockerfile) 1. installs dependencies - 1. installs the GeoServer by downloading and extracting the war file + 1. installs the GeoServer by adding a ZIP and extracting the WAR from it + 1. the expected file name of the war in the zip is `geoserver.war` + 1. by default, the GeoServer URL from sourceforge is used, but you could also provide a custom URL with a zip in the `GEOSERVER_WAR_SRC` build argument. + 1. you can also use the `GEOSERVER_WAR_SRC` build argument to burn your custom WAR file from your local machine to the docker image, e.g. with something like `docker build -t geoserver:test --build-arg GEOSERVER_WAR_SRC="./resources/geoserver.zip" .` 1. defines defaults for environment variables 1. The [entrypoint.sh](scripts/entrypoint.sh) startup script (in a running container) 1. executes [install-extensions.sh](scripts/install-extensions.sh) to download and install GeoServer extensions based on the `STABLE_EXTENSIONS` environment variable. diff --git a/docker-compose-demo.yml b/docker-compose-demo.yml index de2385a..df67b48 100644 --- a/docker-compose-demo.yml +++ b/docker-compose-demo.yml @@ -4,7 +4,7 @@ services: build: context: . args: - - GEOSERVER_VERSION=2.18.1 + - GEOSERVER_VERSION=2.18.2 - CORS_ENABLED=true - CORS_ALLOWED_METHODS=GET,POST,PUT,HEAD,OPTIONS ports: