blob: e47f88bd1b3d0c3ff5d5f2031e60b53f1e26c857 [file] [log] [blame]
Lukasz Rajewski339c62e2023-03-23 09:26:07 +00001ARG java_ver=onap-java11
mrichommeb095cb92020-01-20 18:23:08 +01002
Lukasz Rajewski339c62e2023-03-23 09:26:07 +00003# Java v11 base image
4FROM eclipse-temurin:11.0.18_10-jre-alpine AS onap-java11
5
6# Java v17 base image
7FROM eclipse-temurin:17.0.6_10-jre-alpine AS onap-java17
8
9FROM ${java_ver} AS onap-java-final
10
11LABEL maintainer="ONAP Integration team"
12LABEL Description="Reference ONAP JAVA image based on alpine"
mrichommeb095cb92020-01-20 18:23:08 +010013
14ENV JAVA_OPTS="-Xms256m -Xmx1g"
15ENV JAVA_SEC_OPTS=""
16
17ARG user=onap
18ARG group=onap
19
Jan Malkiewiczbeaaa272020-12-01 14:32:52 +010020# Install additional tools
Abdelmuhaimen Seaudiad17a402021-09-05 16:18:02 +020021RUN apk add --no-cache openssl ca-certificates
Jan Malkiewiczbeaaa272020-12-01 14:32:52 +010022
mrichommeb095cb92020-01-20 18:23:08 +010023# Create a group and user
mrichommeabdb7a92020-08-07 14:54:22 +020024RUN addgroup -S $group && adduser -G $group -D $user && \
mrichommeb095cb92020-01-20 18:23:08 +010025 mkdir /var/log/$user && \
mrichommeabdb7a92020-08-07 14:54:22 +020026 mkdir /app && \
27 chown -R $user:$group /var/log/$user && \
28 chown -R $user:$group /app
mrichommeb095cb92020-01-20 18:23:08 +010029
30# Tell docker that all future commands should be run as the onap user
31USER $user
mrichommeabdb7a92020-08-07 14:54:22 +020032WORKDIR /app
mrichommeb095cb92020-01-20 18:23:08 +010033
mrichommeabdb7a92020-08-07 14:54:22 +020034ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar