Last active
May 24, 2018 20:06
-
-
Save lucas-dclrcq/35455b02d7125fc2517a854a095f6536 to your computer and use it in GitHub Desktop.
Spring Boot Java 10 Multi Stage Docker Build
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
### STAGE 1: Build ### | |
FROM maven:3.5.3-jdk-10-slim as build | |
COPY src /usr/src/app/src | |
COPY pom.xml /usr/src/app | |
RUN mvn -f /usr/src/app/pom.xml clean package | |
### STAGE 2: Setup ### | |
FROM openjdk:10.0.1-10-jdk-sid | |
COPY --from=build \ | |
/usr/src/app/target/*.jar /usr/app/app.jar | |
EXPOSE 8080 | |
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","app.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment