mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 1 | FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 2 | |
| 3 | LABEL maintainer="ONAP Integration team, morgan.richomme@orange.com" |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 4 | LABEL Description="Reference ONAP JAVA 11 image based on alpine" |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 5 | |
| 6 | ENV JAVA_OPTS="-Xms256m -Xmx1g" |
| 7 | ENV JAVA_SEC_OPTS="" |
| 8 | |
| 9 | ARG user=onap |
| 10 | ARG group=onap |
| 11 | |
| 12 | # Create a group and user |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 13 | RUN addgroup -S $group && adduser -G $group -D $user && \ |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 14 | mkdir /var/log/$user && \ |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 15 | mkdir /app && \ |
| 16 | chown -R $user:$group /var/log/$user && \ |
| 17 | chown -R $user:$group /app |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 18 | |
| 19 | # Tell docker that all future commands should be run as the onap user |
| 20 | USER $user |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 21 | WORKDIR /app |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 22 | |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 23 | ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar |