From cfbcb7de9d62bfc140eb2e9845713c699634eef5 Mon Sep 17 00:00:00 2001 From: David Avendasora Date: Thu, 8 Sep 2022 12:26:23 +0700 Subject: [PATCH] Store Alpine & Centos java preferences in ~/.java Pass java system properties to image using the JAVA_OPS environment variable, the same way the Unbuntu Dockerfile already does. The directories were created earlier in the Dockerfile, but never set in the image. --- dockerfiles/alpine/is/Dockerfile | 3 ++- dockerfiles/centos/is/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dockerfiles/alpine/is/Dockerfile b/dockerfiles/alpine/is/Dockerfile index 8661b120..9adf6376 100755 --- a/dockerfiles/alpine/is/Dockerfile +++ b/dockerfiles/alpine/is/Dockerfile @@ -125,7 +125,8 @@ USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables -ENV WORKING_DIRECTORY=${USER_HOME} \ +ENV JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}" \ + WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} # expose ports diff --git a/dockerfiles/centos/is/Dockerfile b/dockerfiles/centos/is/Dockerfile index 31527787..1bdd267c 100755 --- a/dockerfiles/centos/is/Dockerfile +++ b/dockerfiles/centos/is/Dockerfile @@ -121,7 +121,8 @@ USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables -ENV WORKING_DIRECTORY=${USER_HOME} \ +ENV JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}" \ + WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} # expose ports