Skip to content

Instantly share code, notes, and snippets.

@avinash10584
Created June 1, 2020 20:41
Show Gist options
  • Save avinash10584/1ee37f7ed05d179ee421e4c77c2fa1fe to your computer and use it in GitHub Desktop.
Save avinash10584/1ee37f7ed05d179ee421e4c77c2fa1fe to your computer and use it in GitHub Desktop.
FROM openjdk:15-jdk-slim as bulid
WORKDIR application
COPY mvnw .
COPY .mvn .mvn
COPY pom.xml .
COPY src src
RUN ./mvnw install -DskipTests
RUN cp /application/target/*.jar app.jar
RUN java -Djarmode=layertools -jar app.jar extract
FROM openjdk:15-jdk-slim
WORKDIR application
COPY --from=bulid application/dependencies/ ./
COPY --from=bulid application/spring-boot-loader/ ./
COPY --from=bulid application/snapshot-dependencies/ ./
COPY --from=bulid application/application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment