Lukasz Rajewski | 339c62e | 2023-03-23 09:26:07 +0000 | [diff] [blame] | 1 | ARG java_ver=onap-java11 |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 2 | |
Lukasz Rajewski | 339c62e | 2023-03-23 09:26:07 +0000 | [diff] [blame] | 3 | # Java v11 base image |
| 4 | FROM eclipse-temurin:11.0.18_10-jre-alpine AS onap-java11 |
| 5 | |
| 6 | # Java v17 base image |
| 7 | FROM eclipse-temurin:17.0.6_10-jre-alpine AS onap-java17 |
| 8 | |
| 9 | FROM ${java_ver} AS onap-java-final |
| 10 | |
| 11 | LABEL maintainer="ONAP Integration team" |
| 12 | LABEL Description="Reference ONAP JAVA image based on alpine" |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 13 | |
| 14 | ENV JAVA_OPTS="-Xms256m -Xmx1g" |
| 15 | ENV JAVA_SEC_OPTS="" |
| 16 | |
| 17 | ARG user=onap |
| 18 | ARG group=onap |
| 19 | |
Jan Malkiewicz | beaaa27 | 2020-12-01 14:32:52 +0100 | [diff] [blame] | 20 | # Install additional tools |
Abdelmuhaimen Seaudi | ad17a40 | 2021-09-05 16:18:02 +0200 | [diff] [blame] | 21 | RUN apk add --no-cache openssl ca-certificates |
Jan Malkiewicz | beaaa27 | 2020-12-01 14:32:52 +0100 | [diff] [blame] | 22 | |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 23 | # Create a group and user |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 24 | RUN addgroup -S $group && adduser -G $group -D $user && \ |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 25 | mkdir /var/log/$user && \ |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 26 | mkdir /app && \ |
| 27 | chown -R $user:$group /var/log/$user && \ |
| 28 | chown -R $user:$group /app |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 29 | |
| 30 | # Tell docker that all future commands should be run as the onap user |
| 31 | USER $user |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 32 | WORKDIR /app |
mrichomme | b095cb9 | 2020-01-20 18:23:08 +0100 | [diff] [blame] | 33 | |
mrichomme | abdb7a9 | 2020-08-07 14:54:22 +0200 | [diff] [blame] | 34 | ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar |