From f0a529057f953efcd04555169e7dbbbe4d550b86 Mon Sep 17 00:00:00 2001 From: Mark Prins <1165786+mprins@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:35:55 +0200 Subject: [PATCH] HTM-1238: Update tomcat and use the Marlin renderer (#6) Also use the new RelateNG options And remove settings from entrypoint JAVA_OPTS --- geoserver/Dockerfile | 24 ++++++++++++++++++- .../docker-entrypoint-initdb.d/entrypoint.sh | 3 ++- postgis/Dockerfile | 2 +- sqlserver/Dockerfile | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/geoserver/Dockerfile b/geoserver/Dockerfile index 634379a..8df14cf 100644 --- a/geoserver/Dockerfile +++ b/geoserver/Dockerfile @@ -5,11 +5,32 @@ COPY maven/ /tmp/ RUN mvn -U clean package --fail-at-end --settings .mvn/settings.xml -FROM tomcat:9.0.94-jre17-temurin AS geoserver +FROM tomcat:9.0.95-jre17-temurin AS geoserver ARG TZ="Europe/Amsterdam" ARG GEOSERVER_DATA_DIR="/opt/geoserver-data" +ENV JDK_JAVA_OPTIONS="-Djava.awt.headless=true \ + -Djava.security.egd=file:/dev/./urandom \ + -server -Xms256m -Xmx1g \ + --add-exports=java.desktop/sun.awt.image=ALL-UNNAMED \ + --add-opens=java.base/java.lang=ALL-UNNAMED \ + --add-opens=java.base/java.util=ALL-UNNAMED \ + --add-opens=java.base/java.lang.reflect=ALL-UNNAMED \ + --add-opens=java.base/java.text=ALL-UNNAMED \ + --add-opens=java.desktop/java.awt.font=ALL-UNNAMED \ + --add-opens=java.desktop/sun.awt.image=ALL-UNNAMED \ + --add-opens=java.naming/com.sun.jndi.ldap=ALL-UNNAMED \ + --add-opens=java.desktop/sun.java2d.pipe=ALL-UNNAMED \ + -Dfile.encoding=UTF-8 \ + -Djavax.servlet.request.encoding=UTF-8 \ + -Djavax.servlet.response.encoding=UTF-8 \ + -D-XX:SoftRefLRUPolicyMSPerMB=36000 \ + -Xbootclasspath/a:$CATALINA_HOME/lib/marlin.jar \ + -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine \ + -Dorg.geotools.coverage.jaiext.enabled=true \ + -Djts.relate=ng" + RUN set -eux;ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ # cleanup localization and example apps && rm /usr/local/tomcat/lib/tomcat-i18n-*.jar \ @@ -26,6 +47,7 @@ RUN set -eux;ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/t && chown -R www-data:www-data $GEOSERVER_DATA_DIR COPY --chown=www-data:www-data --from=builder /tmp/target/geoserver.war /usr/local/tomcat/webapps/ +COPY --from=builder /tmp/target/geoserver/WEB-INF/lib/marlin-*.jar /usr/local/tomcat/lib/marlin.jar COPY --chown=www-data:www-data maven/src/main/webapp/data/ $GEOSERVER_DATA_DIR COPY ./docker-entrypoint-initdb.d /docker-entrypoint-initdb.d diff --git a/geoserver/docker-entrypoint-initdb.d/entrypoint.sh b/geoserver/docker-entrypoint-initdb.d/entrypoint.sh index e0d8ac8..b71cb9e 100755 --- a/geoserver/docker-entrypoint-initdb.d/entrypoint.sh +++ b/geoserver/docker-entrypoint-initdb.d/entrypoint.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e -JAVA_OPTS="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom" + +#JAVA_OPTS= # start tomcat, start the script to update the passwords /docker-entrypoint-initdb.d/0-reset_passwords.sh & catalina.sh run \ No newline at end of file diff --git a/postgis/Dockerfile b/postgis/Dockerfile index 1ef054e..cd44535 100644 --- a/postgis/Dockerfile +++ b/postgis/Dockerfile @@ -1,6 +1,6 @@ FROM postgis/postgis:16-3.4 -ENV LANG en_US.utf8 +ENV LANG=en_US.utf8 ARG TZ="Europe/Amsterdam" diff --git a/sqlserver/Dockerfile b/sqlserver/Dockerfile index 2bc7676..15c4815 100644 --- a/sqlserver/Dockerfile +++ b/sqlserver/Dockerfile @@ -1,6 +1,6 @@ FROM mcr.microsoft.com/mssql/server:2022-latest -ENV LANG en_US.utf8 +ENV LANG=en_US.utf8 ENV ACCEPT_EULA=Y ARG TZ="Europe/Amsterdam"