aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2020-08-07 14:54:22 +0200
committermrichomme <morgan.richomme@orange.com>2020-08-10 13:47:01 +0200
commitabdb7a9b2769033983b12949f98618da02efa21a (patch)
treed7e819723782ff5e6a24a6b86cf94179b7155159 /Dockerfile
parent529ee210e9e6465de781ab5bae5d02e7474d80ff (diff)
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 <morgan.richomme@orange.com> Change-Id: I80f5edea0c4d579e132229c8567a22de7b146d01 Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 files changed, 8 insertions, 9 deletions
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