blob: 6585b1d60b4e069651c323554bf4e9440112d5ea [file] [log] [blame]
mrichommeabdb7a92020-08-07 14:54:22 +02001FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine
mrichommeb095cb92020-01-20 18:23:08 +01002
3LABEL maintainer="ONAP Integration team, morgan.richomme@orange.com"
mrichommeabdb7a92020-08-07 14:54:22 +02004LABEL Description="Reference ONAP JAVA 11 image based on alpine"
mrichommeb095cb92020-01-20 18:23:08 +01005
6ENV JAVA_OPTS="-Xms256m -Xmx1g"
7ENV JAVA_SEC_OPTS=""
8
9ARG user=onap
10ARG group=onap
11
12# Create a group and user
mrichommeabdb7a92020-08-07 14:54:22 +020013RUN addgroup -S $group && adduser -G $group -D $user && \
mrichommeb095cb92020-01-20 18:23:08 +010014 mkdir /var/log/$user && \
mrichommeabdb7a92020-08-07 14:54:22 +020015 mkdir /app && \
16 chown -R $user:$group /var/log/$user && \
17 chown -R $user:$group /app
mrichommeb095cb92020-01-20 18:23:08 +010018
19# Tell docker that all future commands should be run as the onap user
20USER $user
mrichommeabdb7a92020-08-07 14:54:22 +020021WORKDIR /app
mrichommeb095cb92020-01-20 18:23:08 +010022
mrichommeabdb7a92020-08-07 14:54:22 +020023ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar