title: Maven + Java application in Dockerfile
body: <p>I am new to java and maven. I have built an application that executes a flink job. I have created a base docker image but I am not sure how to excecute/run like I run the application in the terminal. </p>
  
  <p>I currently run the application in the terminal as follows: </p>
  
  <pre><code> mvn package exec:java `-D exec.args="--runner=FlinkRunner --flinkMaster=localhost:8081 --filesToStage=.\target\maven_benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar `" -P flink-runner`
  </code></pre>
  
  <p>Here is my docker file</p>
  
  <pre><code>FROM maven:latest AS build
  COPY src /usr/src/app/src
  COPY pom.xml /usr/src/app
  RUN mvn -f /usr/src/app/pom.xml clean package
  
  FROM openjdk:14
  COPY --from=build /usr/src/app/target/maven_benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar /usr/app/maven_benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar
  WORKDIR /usr/app
  EXPOSE 8080
  ENTRYPOINT ["java","-jar","maven_benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar"]
  </code></pre>
  
  <p>Any suggestions? </p>
  
  <p>Thanks in advance!</p>