DCD-1086: Add Google Noto fonts and install as JVM fallback for server-side rendering of non-Latin languages.

This commit is contained in:
Steve Smith 2020-08-24 13:24:52 +10:00
parent 284acb9a30
commit e6204bab7a
2 changed files with 14 additions and 2 deletions

View File

@ -20,7 +20,7 @@ CMD ["/entrypoint.py"]
ENTRYPOINT ["/sbin/tini", "--"]
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends fontconfig python3 python3-jinja2 \
&& apt-get install -y --no-install-recommends fontconfig fonts-noto python3 python3-jinja2 \
&& apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
ARG TINI_VERSION=v0.18.0
@ -45,7 +45,10 @@ RUN groupadd --gid ${RUN_GID} ${RUN_GROUP} \
\
&& sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \
&& sed -i -e 's/-XX:ReservedCodeCacheSize=\([0-9]\+[kmg]\)/-XX:ReservedCodeCacheSize=${JVM_RESERVED_CODE_CACHE_SIZE:=\1}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \
&& sed -i -e 's/export CATALINA_OPTS/CATALINA_OPTS="\${CATALINA_OPTS} \${JVM_SUPPORT_RECOMMENDED_ARGS}"\n\nexport CATALINA_OPTS/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh
&& sed -i -e 's/export CATALINA_OPTS/CATALINA_OPTS="\${CATALINA_OPTS} \${JVM_SUPPORT_RECOMMENDED_ARGS}"\n\nexport CATALINA_OPTS/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh \
\
&& mkdir -p /opt/java/openjdk/lib/fonts/fallback/ \
&& ln -sf /usr/share/fonts/truetype/noto/* /opt/java/openjdk/lib/fonts/fallback/
VOLUME ["${CONFLUENCE_HOME}"] # Must be declared after setting perms

View File

@ -331,3 +331,12 @@ def test_jvm_support_recommended_args_order(docker_cli, image):
procs_list = get_procs(container)
jvm = [proc for proc in procs_list if get_bootstrap_proc(container) in proc][0]
assert jvm.index(ENABLE_PRINTGCDETAILS) > jvm.index(DISABLE_PRINTGCDETAILS)
def test_jvm_fallback_fonts(docker_cli, image):
container = run_image(docker_cli, image)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
init = container.file("/opt/java/openjdk/lib/fonts/fallback/NotoSansGujarati-Regular.ttf")
assert init.exists
assert init.is_symlink
assert init.linked_to == '/usr/share/fonts/truetype/noto/NotoSansGujarati-Regular.ttf'