diff options
author | Maharajh, Robby (rx2202) <rx2202@us.att.com> | 2021-02-24 13:32:28 -0500 |
---|---|---|
committer | Maharajh, Robby (rx2202) <rx2202@us.att.com> | 2021-02-24 14:59:27 -0500 |
commit | e83a8f36c3f566fa8b379a85c73d27f6e29c61af (patch) | |
tree | f5b7ad69ac6b59aeb8da31721663ecd9cc2283ba /src/main | |
parent | aecbb49acfb4dfb3ee5abd0b96a46f38a4b2f568 (diff) |
Update model loader to use java 11
Issue-ID: AAI-3004
Change-Id: I85ab6634bee7cb8c58fdc63cfd15de4b6955681a
Signed-off-by: Maharajh, Robby (rx2202) <rx2202@us.att.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/bin/start.sh | 22 | ||||
-rw-r--r-- | src/main/docker/Dockerfile | 19 |
2 files changed, 10 insertions, 31 deletions
diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh index 1dedb25..19d2717 100644 --- a/src/main/bin/start.sh +++ b/src/main/bin/start.sh @@ -20,13 +20,6 @@ # ============LICENSE_END============================================ #******************************************************************************* -# jre-alpine image has $JAVA_HOME set and added to $PATH -# ubuntu image requires to set $JAVA_HOME and add java to $PATH manually -if ( uname -v | grep -i "ubuntu" ); then - export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-`dpkg --print-architecture | awk -F- '{ print $NF }'` - export PATH=${JAVA_HOME}:$PATH -fi - # AJSC_HOME is required for EELF logging. # This path is referenced in the file logback.xml. AJSC_HOME="${AJSC_HOME-/opt/app/model-loader}" @@ -37,6 +30,8 @@ if [ -z "$CONFIG_HOME" ]; then exit 1 fi +JARFILE=$(ls ./model-loader*.jar); + # Some properties are repeated here for debugging purposes. PROPS="-DAJSC_HOME=$AJSC_HOME" PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" @@ -46,18 +41,5 @@ PROPS="$PROPS -Dlogback.configurationFile=$AJSC_HOME/logback.xml" PROPS="$PROPS -Dserver.port=9500" JVM_MAX_HEAP=${MAX_HEAP:-1024} -if [ -z "${java_runtime_arguments}" ]; then - java_runtime_arguments="-Xms75m -Xmx${JVM_MAX_HEAP}m \ - -Dcom.sun.management.jmxremote \ - -Dcom.sun.management.jmxremote.authenticate=false \ - -Dcom.sun.management.jmxremote.ssl=false \ - -Dcom.sun.management.jmxremote.local.only=false \ - -Dcom.sun.management.jmxremote.port=1099 \ - -Dcom.sun.management.jmxremote.rmi.port=1099 \ - -Djava.rmi.server.hostname=127.0.0.1" -fi - -JARFILE=$(ls ./model-loader*.jar); - echo "java $java_runtime_arguments $PROPS -jar $JARFILE" java $java_runtime_arguments $PROPS -jar $JARFILE diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index a4da9af..10bc3e6 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -2,20 +2,17 @@ FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@ ARG MICRO_HOME=/opt/app/model-loader -# Build up the deployment folder structure -RUN mkdir -p $MICRO_HOME $MICRO_HOME/logs - -RUN groupadd aaiadmin -g 1000 -RUN adduser -u 1000 -h /opt/aaihome/aaiadmin -S -D -G aaiadmin -s /bin/bash aaiadmin WORKDIR $MICRO_HOME -RUN chown -R aaiadmin:aaiadmin $MICRO_HOME $MICRO_HOME/logs +USER root -COPY --chown=aaiadmin:aaiadmin /maven/model-loader/ . +RUN mkdir -p /opt/aaihome $MICRO_HOME /logs && \ + ln -s /logs $MICRO_HOME/logs && \ + chown -R aaiadmin:aaiadmin $MICRO_HOME && \ + chown -R aaiadmin:aaiadmin /logs -USER aaiadmin +COPY --chown=aaiadmin:aaiadmin /maven/model-loader/ . -RUN chmod 755 bin/* \ - && ln -s /logs $MICRO_HOME/logs +ENTRYPOINT ["/bin/bash", "/opt/app/model-loader/bin/start.sh"] -CMD ["/opt/app/model-loader/bin/start.sh"] +USER aaiadmin |