Last active
June 15, 2020 04:36
-
-
Save avinash10584/184d9cc465ffe981e9e999bfa73955f2 to your computer and use it in GitHub Desktop.
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
# syntax = docker/dockerfile:experimental | |
FROM openjdk:15-jdk-slim as bulid | |
WORKDIR application | |
COPY mvnw . | |
COPY .mvn .mvn | |
COPY pom.xml . | |
COPY src src | |
RUN --mount=type=cache,target=/root/.m2 ./mvnw install -DskipTests | |
RUN cp /application/target/*.jar app.jar | |
RUN java -Djarmode=layertools -jar app.jar extract | |
RUN addgroup demogroup && adduser --ingroup demogroup --disabled-password demo | |
USER demo | |
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