summaryrefslogtreecommitdiffstats
path: root/dcae-analytics/dcae-analytics-tca-web/Dockerfile
diff options
context:
space:
mode:
authorJegadeesh Babu <jegabab1@in.ibm.com>2019-05-14 13:42:46 +0530
committerJegadeesh Babu <jegabab1@in.ibm.com>2019-05-14 13:45:12 +0530
commitddb39820395d7fcb8a898eff9e08bc725680e3c2 (patch)
tree5450ae76aaf4e40b5e376055c541157507e77a0a /dcae-analytics/dcae-analytics-tca-web/Dockerfile
parent7791b721b19906d59236167bf92cd221aedd21b0 (diff)
Updated pom and docker to generate a stable image
Modified files to produce stable image Issue-ID: DCAEGEN2-1482 Change-Id: I3aeff6dd2fd208e51b9d6d52c6518d004bbecef8 Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-web/Dockerfile')
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/Dockerfile26
1 files changed, 17 insertions, 9 deletions
diff --git a/dcae-analytics/dcae-analytics-tca-web/Dockerfile b/dcae-analytics/dcae-analytics-tca-web/Dockerfile
index 0e2a6e8..c573ae9 100644
--- a/dcae-analytics/dcae-analytics-tca-web/Dockerfile
+++ b/dcae-analytics/dcae-analytics-tca-web/Dockerfile
@@ -7,13 +7,21 @@ FROM openjdk:8-jre-alpine
MAINTAINER Rajiv Singla <rs153v@att.com>
-VOLUME /tmp
-ADD logback.xml logback.xml
-EXPOSE 9091
+ARG PROJECT_BUILD_DIR_NAME
+ARG FINAL_JAR
+ARG DEPENDENCIES_DIR
+ARG DOCKER_ARTIFACT_DIR
-ENTRYPOINT ["java", \
- "-Djava.security.egd=file:/dev/./urandom", \
- "-Dlogging.config=logback.xml", \
- "-Dlogging.file=logs/${project.artifactId}.log", \
- "-Dspring.profiles.active=dev", \
- "-jar", "${project.build.finalName}.jar"]
+#Add a new user and group to allow container to be run as non-root
+RUN addgroup -S tca-gen2 && adduser -S -G tca-gen2 tca-gen2
+
+#Copy dependencies and executable jar
+WORKDIR ${DOCKER_ARTIFACT_DIR}
+COPY ${PROJECT_BUILD_DIR_NAME}/${FINAL_JAR} .
+#Overcome Docker limitation to put ARG inside ENTRYPOINT
+RUN ln -s ${FINAL_JAR} tca-gen2.jar
+
+EXPOSE 8100
+
+USER tca-gen2:tca-gen2
+ENTRYPOINT ["java", "-jar", "tca-gen2.jar"]