Last active
June 2, 2020 08:42
-
-
Save myclau/bd1ce583238e25e3778b1c8697401b94 to your computer and use it in GitHub Desktop.
maven docker build image sample
This file contains 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
# | |
# Build stage | |
# | |
FROM maven:3.6.0-jdk-11-slim AS build | |
COPY src /home/app/src | |
COPY pom.xml /home/app | |
RUN mvn -f /home/app/pom.xml clean package | |
# | |
# Package stage | |
# | |
FROM openjdk:11-jre-slim | |
COPY --from=build /home/app/target/demo-0.0.1-SNAPSHOT.jar /usr/local/lib/demo.jar | |
EXPOSE 8080 | |
ENTRYPOINT ["java","-jar","/usr/local/lib/demo.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment