Skip to content

Major improvements (data-dir, python, locations)#85

Open
etj wants to merge 5 commits into
masterfrom
57_datadir
Open

Major improvements (data-dir, python, locations)#85
etj wants to merge 5 commits into
masterfrom
57_datadir

Conversation

@etj

@etj etj commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
  • Fixes Make the geoserver container populate the datadir, at runtime #57
    • removes geoserver-data-dir image
    • makes geoserver image deal with the population of the data dir
  • removes python dependencies
    • move j2 temlpate to envsubst template
    • rewrite tasks.py into a bah script
  • file locations refactoring
  • scripts relocated into /usr/local/bin in image
  • JAVA_OPTS cleanup

Needs changes in docker compose in geonode and geonode-project, so let's release it as a different tag

Copilot AI review requested due to automatic review settings July 3, 2026 13:17

This comment was marked as outdated.

This comment was marked as outdated.

@etj etj changed the title Major improvements Major improvements (data-dir, python, locations) Jul 6, 2026
@etj etj requested review from Copilot and giohappy July 6, 2026 10:08
@etj etj self-assigned this Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 15 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (3)

docker/geoserver/scripts/entrypoint.sh:33

  • This glob moves both "$TMP_EXTRACT/data/" and "$TMP_EXTRACT/data/.". In bash, the second glob expands to "." and ".." as well, which can cause errors and can attempt to move the parent directory into GEOSERVER_DATA_DIR. This can lead to incomplete/failed datadir initialization on first boot.
    docker/geoserver/scripts/entrypoint.sh:21
  • GEOSERVER_DATA_DIR is expanded unquoted. While unlikely, an unexpected value (whitespace, glob chars) could cause mkdir to create the wrong path(s). Quoting is safer and consistent with the rest of the script.
    docker/geoserver/scripts/set_geoserver_auth.sh:48
  • The escape_regex() implementation uses a character class containing "@/-" which is interpreted as a range in many regex engines, making the escaping behavior broader than intended (and potentially incorrect) if this helper is used. If you keep the function, fix the character class so '-' is treated literally.

Comment thread docker/geoserver/Dockerfile Outdated
VOLUME $GEOSERVER_DATA_DIR

ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:MaxPermSize=512m -XX:PermSize=256m -Xms512m -Xmx2048m -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"
ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:MaxPermSize=512m -XX:PermSize=256m -Xms2048m -Xmx2048m -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"
Comment thread docker/geoserver/Dockerfile Outdated
@@ -1,8 +1,8 @@
ARG IMAGE_VERSION=9.0.106-jdk11-temurin-jammy
ARG IMAGE_VERSION=9.0.118-jdk17-temurin-jammy
ARG JAVA_HOME=/usr/local/openjdk-11
@etj

etj commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Cleaning up JAVA_OPTS:

Old:

ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:MaxPermSize=512m -XX:PermSize=256m -Xms2048m -Xmx2048m -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"

New:

ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -Xms2048m -Xmx2048m XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf
  • -XX:PermSize=256m and -XX:MaxPermSize=512m
    The Problem: The Permanent Generation (PermGen) space was entirely removed back in Java 8 and replaced by Metaspace.
  • -XX:+UseConcMarkSweepGC
    The Problem: The Concurrent Mark Sweep (CMS) Garbage Collector was fully removed in Java 14.
  • -Xbootclasspath/a:.../marlin-0.9.3.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine
    The Problem: In older Java versions, GeoServer explicitly included the external Marlin rendering engine jar to speed up vector tiling and shape generation. Since Java 9, the Marlin Renderer has been baked directly into the standard JDK runtime framework. Furthermore, -Xbootclasspath restrictions are extremely strict under Java 17's encapsulation architecture.

Let's make sure these changes are also reported in the sample env files in GeoNode and projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the geoserver container populate the datadir, at runtime

2 participants