summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@linuxfoundation.org>2020-02-07 18:56:48 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-07 18:56:48 +0000
commitb29c3e7cbd3b6155355e9cb68596bf63f500b7ba (patch)
tree07f7149668356e0321e055aebc8a57689115ef37
parent2698bb73e33ad3bfae48387bd5539a6c572abb09 (diff)
parentb095cb9cc362e557611b2e1a92c96df0c76989ad (diff)
Merge "Add Dockerfile to build onap-java docker based on jdk11"
-rw-r--r--Dockerfile24
-rw-r--r--README.md16
2 files changed, 40 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..28974ca
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,24 @@
+FROM openjdk:11.0.5-jre-slim
+
+LABEL maintainer="ONAP Integration team, morgan.richomme@orange.com"
+LABEL Description="Reference ONAP JAVA 11 image"
+
+ENV JAVA_OPTS="-Xms256m -Xmx1g"
+ENV JAVA_SEC_OPTS=""
+
+ARG user=onap
+ARG group=onap
+
+# Create a group and user
+RUN groupadd -r $group && useradd -ms /bin/bash $user -g $group && \
+ mkdir /opt/$user && \
+ chown -R $user:$group /opt/$user && \
+ mkdir /var/log/$user && \
+ chown -R $user:$group /var/log/$user
+
+
+# Tell docker that all future commands should be run as the onap user
+USER $user
+WORKDIR /opt/$user
+
+ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /opt/$user/app.jar
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9f3bce2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+# onap-java
+
+This project aims to produce a reference ONAP baseline including JAVA 11.
+It is based on the image 11.0.5-jre-slim maintained by the upstream community
+openjdk.
+
+It includes a user and a group onap.
+
+When you create your own docker from this baseline docker (build thanks to the
+Dockerfile hosted in this repository), you need to copy your jar file under
+/opt/onap/app.jar.
+
+You may specify 2 env variable to customize the way you are starting java:
+
+- ENV JAVA_OPTS: set to -Xms256m -Xmx1g by default
+- ENV JAVA_SEC_OPTS: empty by default