From abdb7a9b2769033983b12949f98618da02efa21a Mon Sep 17 00:00:00 2001 From: mrichomme Date: Fri, 7 Aug 2020 14:54:22 +0200 Subject: Create alpine java11 baseline image It is based on openjdk11:jre-11.0.8_10-alpine As it is based on alpine it is GPLv3 free Issue-ID: INT-1680 Signed-off-by: mrichomme Change-Id: I80f5edea0c4d579e132229c8567a22de7b146d01 Signed-off-by: mrichomme --- Dockerfile | 17 ++++++++--------- version.properties | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 version.properties diff --git a/Dockerfile b/Dockerfile index 214ad3b..6585b1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM openjdk:11.0.6-jre-slim +FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine LABEL maintainer="ONAP Integration team, morgan.richomme@orange.com" -LABEL Description="Reference ONAP JAVA 11 image" +LABEL Description="Reference ONAP JAVA 11 image based on alpine" ENV JAVA_OPTS="-Xms256m -Xmx1g" ENV JAVA_SEC_OPTS="" @@ -10,15 +10,14 @@ ARG user=onap ARG group=onap # Create a group and user -RUN groupadd -r $group && useradd -ms /bin/bash $user -g $group && \ - mkdir /opt/$user && \ - chown -R $user:$group /opt/$user && \ +RUN addgroup -S $group && adduser -G $group -D $user && \ mkdir /var/log/$user && \ - chown -R $user:$group /var/log/$user - + mkdir /app && \ + chown -R $user:$group /var/log/$user && \ + chown -R $user:$group /app # Tell docker that all future commands should be run as the onap user USER $user -WORKDIR /opt/$user +WORKDIR /app -ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /opt/$user/app.jar +ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..0d3ec56 --- /dev/null +++ b/version.properties @@ -0,0 +1,14 @@ +########################################################### +# Versioning variables +# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) +# because they are used in Jenkins, whose plug-in doesn't support + +major_version=7 +minor_version=0 +patch_version=0 + +base_version=${major_version}.${minor_version}.${patch_version} + +# Release must be completed with GIT information # in Jenkins +release_version=${base_version} +snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg