From 6da98d655e5ab9e30a1a0ae7b5ad613eaec0658b Mon Sep 17 00:00:00 2001 From: Thomas Thelen Date: Wed, 8 Jul 2026 07:27:25 -0700 Subject: [PATCH] GH:1998 Support more locales in the Fuseki docker image --- jena-fuseki2/jena-fuseki-docker/Dockerfile | 12 ++++++++++-- jena-fuseki2/jena-fuseki-docker/README.md | 13 +++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/jena-fuseki2/jena-fuseki-docker/Dockerfile b/jena-fuseki2/jena-fuseki-docker/Dockerfile index 7f9a3c7db12..808ebb38fb5 100644 --- a/jena-fuseki2/jena-fuseki-docker/Dockerfile +++ b/jena-fuseki2/jena-fuseki-docker/Dockerfile @@ -61,13 +61,21 @@ RUN ./download.sh --chksum sha1 "$JAR_URL" ## -- Make reduced Java JDK -ARG JDEPS_EXTRA="jdk.crypto.cryptoki,jdk.crypto.ec" +## Provides locale data. Jdeps does not detect it because of SPI, so add it here. +ARG JDEPS_EXTRA="jdk.crypto.cryptoki,jdk.crypto.ec,jdk.localedata" + +## Optional: comma-separated list of locale language tags to keep from jdk.localedata, +## e.g. "en,fr,de,fi". Leave empty to include all locales. +ARG JDK_LOCALES="" + RUN \ JDEPS="$(jdeps --multi-release base --print-module-deps --ignore-missing-deps ${FUSEKI_JAR})" && \ + if [ -n "${JDK_LOCALES}" ] ; then LOCALE_OPT="--include-locales=${JDK_LOCALES}" ; else LOCALE_OPT="" ; fi && \ jlink \ --compress 2 --strip-debug --no-header-files --no-man-pages \ --output "${JAVA_MINIMAL}" \ - --add-modules "${JDEPS},${JDEPS_EXTRA}" + --add-modules "${JDEPS},${JDEPS_EXTRA}" \ + ${LOCALE_OPT} ADD entrypoint.sh . ADD log4j2.properties . diff --git a/jena-fuseki2/jena-fuseki-docker/README.md b/jena-fuseki2/jena-fuseki-docker/README.md index e34fb5ad6dd..78bab883fce 100644 --- a/jena-fuseki2/jena-fuseki-docker/README.md +++ b/jena-fuseki2/jena-fuseki-docker/README.md @@ -77,6 +77,19 @@ The default layout in the container is: | /fuseki/log4j2.properties | Logging configuration | | /fuseki/databases/ | Directory for a volume for persistent databases | +## Locales + +The image includes locale data for _all_ locales so that features such as +[ARQ collation](https://jena.apache.org/documentation/query/collation.html) +work correctly for languages other than English. + +To reduce image size, restrict the build to a subset of locales with the +`JDK_LOCALES` build argument and a comma-separated list of language tags to include: + + docker-compose build --build-arg JENA_VERSION=5.3.0 --build-arg JDK_LOCALES=en,fr,de,fi + +Leave `JDK_LOCALES` unset (the default) to include every locale. + ## Setting JVM arguments Use `JAVA_OPTIONS`: