Set up repo for multistage builds, in order to work with docker build .

Change-Id: I83a2d67c42dec0ac0dafc036647a9335d0b5cb06
Signed-off-by: William Kurkian <wkurkian@cisco.com>
diff --git a/Dockerfile b/Dockerfile
index 79e6134..a2c9a4c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1,12 @@
-FROM ubuntu:16.04
-RUN apt-get update && \
-    apt-get upgrade -y && \
-    apt-get install -y openjdk-8-jdk curl less kafkacat && \
-    apt-get clean
+FROM maven:3-jdk-8 as maven
+COPY . /mavenwd
+WORKDIR /mavenwd/
+RUN mvn install:install-file -Dfile=/mavenwd/libs/evel_javalib2-1.1.0.jar
+RUN mvn -f /mavenwd/pom.xml clean package
 
-RUN mkdir /opt/ves-agent && chmod 777 -R /opt/ves-agent
+FROM openjdk:8-jre-alpine
+RUN mkdir -p /opt/ves-agent && chmod 777 -R /opt/ves-agent
 VOLUME /tmp
-ARG JAR_FILE
-ARG PROPERTIES_FILE
-COPY ${PROPERTIES_FILE} /opt/ves-agent/config.properties
-COPY ${JAR_FILE} app.jar
+COPY --from=maven /mavenwd/config/config.properties /opt/ves-agent/config.properties
+COPY --from=maven /mavenwd/target/ves-agent-0.1.0.jar app.jar
 ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
index b16e9a4..5b70602 100644
--- a/Dockerfile.alpine
+++ b/Dockerfile.alpine
@@ -1,5 +1,8 @@
-FROM openjdk:8-jdk-alpine
+FROM openjdk:8-jre-alpine
+RUN mkdir /opt/ves-agent && chmod 777 -R /opt/ves-agent
 VOLUME /tmp
 ARG JAR_FILE
+ARG PROPERTIES_FILE
+COPY ${PROPERTIES_FILE} /opt/ves-agent/config.properties
 COPY ${JAR_FILE} app.jar
 ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
diff --git a/Dockerfile.dev b/Dockerfile.dev
new file mode 100644
index 0000000..79e6134
--- /dev/null
+++ b/Dockerfile.dev
@@ -0,0 +1,13 @@
+FROM ubuntu:16.04
+RUN apt-get update && \
+    apt-get upgrade -y && \
+    apt-get install -y openjdk-8-jdk curl less kafkacat && \
+    apt-get clean
+
+RUN mkdir /opt/ves-agent && chmod 777 -R /opt/ves-agent
+VOLUME /tmp
+ARG JAR_FILE
+ARG PROPERTIES_FILE
+COPY ${PROPERTIES_FILE} /opt/ves-agent/config.properties
+COPY ${JAR_FILE} app.jar
+ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]