Created
November 20, 2019 18:04
-
-
Save Echooff3/72738e19a3a39639cd3575c339bbc876 to your computer and use it in GitHub Desktop.
Docker Maven Build and Run Java 11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM maven:slim as builder | |
COPY . /opt/app | |
WORKDIR /opt/app | |
RUN mvn package -DskipTests | |
FROM openjdk:11-jdk-slim as runtime | |
ARG properties_file=dockerConfigs/dev.application.properties | |
EXPOSE 8080 | |
WORKDIR /opt/app | |
COPY --from=builder /opt/app/target/app-0.0.1-SNAPSHOT.jar ./ | |
COPY ${properties_file} /opt/app/application.properties | |
CMD ["java","-jar","app-0.0.1-SNAPSHOT.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment