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 | |
Jan Malkiewicz | 0a8d7ec | 2020-12-01 14:32:52 +0100 | [diff] [blame] | 12 | # Install additional tools |
| 13 | RUN apk add --no-cache openssl |
| 14 | |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 15 | # Create a group and user |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 16 | RUN addgroup -S $group && adduser -G $group -D $user && \ |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 17 | mkdir /var/log/$user && \ |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 18 | mkdir /app && \ |
| 19 | chown -R $user:$group /var/log/$user && \ |
| 20 | chown -R $user:$group /app |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 21 | |
| 22 | # Tell docker that all future commands should be run as the onap user |
| 23 | USER $user |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 24 | WORKDIR /app |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 25 | |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 26 | ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar |