summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
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