Skip to content

Instantly share code, notes, and snippets.

@amran-bd
Forked from avinash10584/Dockerfile-mvnw
Created December 15, 2023 13:31
Show Gist options
  • Save amran-bd/5ce751dc63df61a3e4fd2a79e5aa5c90 to your computer and use it in GitHub Desktop.
Save amran-bd/5ce751dc63df61a3e4fd2a79e5aa5c90 to your computer and use it in GitHub Desktop.

Revisions

  1. @avinash10584 avinash10584 created this gist Jun 1, 2020.
    20 changes: 20 additions & 0 deletions Dockerfile-mvnw
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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"]