diff options
Diffstat (limited to 'src/main/docker')
-rwxr-xr-x | src/main/docker/Dockerfile | 25 | ||||
-rw-r--r-- | src/main/docker/aai.sh | 9 | ||||
-rw-r--r-- | src/main/docker/docker-entrypoint.sh | 10 |
3 files changed, 14 insertions, 30 deletions
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 731da9a..6a1a05c 100755 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -1,25 +1,24 @@ -FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@ +FROM eclipse-temurin:8-jre-alpine USER root +ENV SERVER_PORT=8449 +EXPOSE ${SERVER_PORT} -RUN mkdir -p /opt/aaihome/aaiadmin /opt/aai/logroot/AAI-GA /opt/app/aai-graphadmin/logs/gc +# curl is used in the putTool script +# (PUT's can't be done using the busybox wget) +RUN apk --no-cache add curl + +RUN mkdir -p /opt/aaihome/aaiadmin /opt/aai/logroot/AAI-GA /opt/app/aai-graphadmin/logs/gc VOLUME /opt/aai/logroot/AAI-GA VOLUME /opt/data VOLUME /opt/tools -HEALTHCHECK --interval=40s --timeout=10s --retries=3 CMD nc -z -v localhost 8449 || exit 1 - # Add the proper files into the docker image from your build WORKDIR /opt/app/aai-graphadmin -RUN chown -R aaiadmin:aaiadmin /opt/app/aai-graphadmin /etc/profile.d /opt/aai/logroot/AAI-GA /opt/app /opt/aai/logroot /opt/app/aai-graphadmin/logs/gc - -COPY --chown=aaiadmin:aaiadmin /maven/aai-graphadmin/ . +RUN chown -R nobody:nobody /opt/app/aai-graphadmin /etc/profile.d /opt/aai/logroot/AAI-GA /opt/app /opt/aai/logroot /opt/app/aai-graphadmin/logs/gc -USER aaiadmin +COPY --chown=nobody:nobody /maven/aai-graphadmin/ . -ENV AAI_BUILD_VERSION @aai.docker.version@ -# Expose the ports for outside linux to use -# 8449 is the important one to be used -EXPOSE 8449 -ENTRYPOINT ["/bin/bash", "/opt/app/aai-graphadmin/docker-entrypoint.sh"]
\ No newline at end of file +USER nobody +ENTRYPOINT ["/bin/sh", "/opt/app/aai-graphadmin/docker-entrypoint.sh"] diff --git a/src/main/docker/aai.sh b/src/main/docker/aai.sh index 4d8b6ce..c1c0398 100644 --- a/src/main/docker/aai.sh +++ b/src/main/docker/aai.sh @@ -20,15 +20,6 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. # -# set system related env -# and make script compatible both with ubuntu and alpine base images -# 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 [ -z $JAVA_HOME ] && [ $(grep -i "ID=ubuntu" /etc/os-release | wc -w) -eq 1 ] ; then - export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-`dpkg --print-architecture | awk -F- '{ print $NF }'` - export PATH=$PATH:${JAVA_HOME}/jre/bin:${JAVA_HOME}/bin -fi - # set app related env export PROJECT_HOME=/opt/app/aai-graphadmin export AAIENV=dev diff --git a/src/main/docker/docker-entrypoint.sh b/src/main/docker/docker-entrypoint.sh index 22da6cf..78bb479 100644 --- a/src/main/docker/docker-entrypoint.sh +++ b/src/main/docker/docker-entrypoint.sh @@ -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. @@ -23,8 +23,6 @@ RESOURCES_HOME=${APP_HOME}/resources/; export SERVER_PORT=${SERVER_PORT:-8449}; -echo "Project Build Version: ${AAI_BUILD_VERSION}"; - find /opt/app/ -name "*.sh" -exec chmod +x {} + if [ -f ${APP_HOME}/aai.sh ]; then @@ -98,10 +96,6 @@ fi JAVA_OPTS="${JAVA_OPTS} -Dserver.port=${SERVER_PORT}"; JAVA_OPTS="${JAVA_OPTS} -DBUNDLECONFIG_DIR=./resources"; JAVA_OPTS="${JAVA_OPTS} -Dserver.local.startpath=${RESOURCES_HOME}"; -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-graphadmin"; 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"; |