Use eclipse-temurin:8-jre-alpine docker base image in aai-resources 59/138359/1
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 1 Jul 2024 15:22:13 +0000 (17:22 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 1 Jul 2024 15:23:06 +0000 (17:23 +0200)
- replace aai-common base image with plain java 8 jre
- remove custom folders and users to simplify setup

Issue-ID: AAI-3912
Change-Id: I248202b74133e0a71ff80bce560f27e147baf016
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
aai-resources/pom.xml
aai-resources/src/main/docker/Dockerfile
aai-resources/src/main/docker/docker-entrypoint.sh
aai-resources/src/main/scripts/install/addManualData.sh
pom.xml
version.properties

index b385805..8191459 100644 (file)
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.onap.aai.resources</groupId>
         <artifactId>resources</artifactId>
-        <version>1.14.3-SNAPSHOT</version>
+        <version>1.14.4-SNAPSHOT</version>
     </parent>
     <properties>
         <java.version>1.8</java.version>
index 754c49a..5c943c8 100644 (file)
@@ -1,32 +1,12 @@
-FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@
+FROM eclipse-temurin:8-jre-alpine
+USER nobody
 
-USER root
-RUN  mkdir -p /opt/aaihome/aaiadmin /opt/aai/logroot/AAI-RES /opt/bulkprocess_load
-
-
-VOLUME /tmp
-VOLUME /opt/tools
-
-HEALTHCHECK --interval=40s --timeout=10s --retries=3 CMD nc -z -v localhost ${SERVER_PORT:-8447} || exit 1
-
-
-
-ENV AAI_BUILD_VERSION @aai.docker.version@
-# Expose the ports for outside linux to use
-# 8447 is the important one to be used
-EXPOSE 8447
+ENV SERVER_PORT=8447
+EXPOSE ${SERVER_PORT}
 
 # Add the proper files into the docker image from your build
 WORKDIR /opt/app/aai-resources
 
-RUN chown -R aaiadmin:aaiadmin \
-  /opt/app/aai-resources \
-  /etc/profile.d \
-  /opt/aai/logroot/AAI-RES \
-  /opt/bulkprocess_load
-
-COPY --chown=aaiadmin:aaiadmin /maven/aai-resources/ .
-
-USER aaiadmin
+COPY --chown=nobody:nobody /maven/aai-resources/ .
 
-ENTRYPOINT ["/bin/bash", "/opt/app/aai-resources/docker-entrypoint.sh"]
+ENTRYPOINT ["/bin/sh", "/opt/app/aai-resources/docker-entrypoint.sh"]
index 97bcb76..b946d85 100644 (file)
@@ -7,9 +7,9 @@
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
-# 
+#
 #      http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,49 +26,6 @@ export SERVER_PORT=${SERVER_PORT:-8447};
 USER_ID=${LOCAL_USER_ID:-9001}
 GROUP_ID=${LOCAL_GROUP_ID:-9001}
 
-find /opt/app/ -name "*.sh" -exec chmod +x {} +
-
-if [ -f ${APP_HOME}/aai.sh ]; then
-
-    ln -s bin scripts
-    ln -s /opt/aai/logroot/AAI-RES logs
-
-    mv ${APP_HOME}/aai.sh /etc/profile.d/aai.sh
-    chmod 755 /etc/profile.d/aai.sh
-
-    scriptName=$1;
-
-    if [ ! -z $scriptName ]; then
-
-        if [ -f ${APP_HOME}/bin/${scriptName} ]; then
-            shift 1;
-            ${APP_HOME}/bin/${scriptName} "$@" || {
-                echo "Failed to run the ${scriptName}";
-                exit 1;
-            }
-        else
-            echo "Unable to find the script ${scriptName} in ${APP_HOME}/bin";
-            exit 1;
-        fi;
-
-        exit 0;
-    fi;
-
-    if [ ! -f ${APP_HOME}/scripts/updatePem.sh ]; then
-        echo "Unable to find the updatePem script";
-        exit 1;
-    else
-        ${APP_HOME}/scripts/updatePem.sh
-    fi;
-
-fi;
-
-mkdir -p /opt/app/aai-resources/logs/gc
-
-if [ -f ${APP_HOME}/resources/aai-resources-swm-vars.sh ]; then
-    source ${APP_HOME}/resources/aai-resources-swm-vars.sh;
-fi;
-
 if [ ! -z "${HEAP_SIZE}" ]; then
     MIN_HEAP_SIZE=${HEAP_SIZE};
     MAX_HEAP_SIZE=${HEAP_SIZE};
@@ -118,7 +75,6 @@ JAVA_OPTS="${JAVA_OPTS} -DAAI_CHEF_ENV=${AAI_CHEF_ENV}";
 JAVA_OPTS="${JAVA_OPTS} -DSCLD_ENV=${SCLD_ENV}";
 JAVA_OPTS="${JAVA_OPTS} -DAFT_ENVIRONMENT=${AFT_ENVIRONMENT}";
 JAVA_OPTS="${JAVA_OPTS} -DlrmName=com.att.ajsc.aai-resources";
-JAVA_OPTS="${JAVA_OPTS} -DAAI_BUILD_VERSION=${AAI_BUILD_VERSION}";
 JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom";
 JAVA_OPTS="${JAVA_OPTS} -Dlogback.configurationFile=./resources/logback.xml";
 JAVA_OPTS="${JAVA_OPTS} -Dloader.path=$APP_HOME/resources";
index 645f7c8..1003f75 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ###
 # ============LICENSE_START=======================================================
@@ -9,9 +9,9 @@
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
-# 
+#
 #      http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/pom.xml b/pom.xml
index 4ad35d5..b43cebf 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
     </parent>
     <groupId>org.onap.aai.resources</groupId>
     <artifactId>resources</artifactId>
-    <version>1.14.3-SNAPSHOT</version>
+    <version>1.14.4-SNAPSHOT</version>
     <name>aai-resources</name>
     <packaging>pom</packaging>
     <modules>
index 466ec95..82f9610 100644 (file)
@@ -5,7 +5,7 @@
 
 major_version=1
 minor_version=14
-patch_version=2
+patch_version=4
 
 base_version=${major_version}.${minor_version}.${patch_version}