Posts

Showing posts with the label multi stage builder

Multi stage builder with gradle

FROM  gradle:jdk11  AS  cache WORKDIR / app ENV GRADLE_USER_HOME / cache COPY build.gradle gradle.properties settings.gradle . / RUN gradle -- no-daemon build -- stacktrace FROM gradle:jdk11 AS builder WORKDIR / app COPY -- from= cache / cache / home / gradle / .gradle COPY . / app / RUN gradle -- no-daemon build -- stacktrace FROM harbor.hub.com / -project / openjdk: 11.0.12 - jre-slim RUN apt-get install - y tzdata # timezone env with default ENV TZ Asia / Tokyo RUN ln - snf / usr / share / zoneinfo / $ TZ / etc / localtime && echo $ TZ > / etc / timezone #COPY ./app/iims/build/libs/iims-1.0-SNAPSHOT.jar /app/ COPY -- from= builder / app / app / iims / build / libs / xxx-1 .0 - SNAPSHOT.jar / app / WORKDIR / app ENTRYPOINT [ "java" , "-jar" , "xxx-1.0-SNAPSHOT.jar" ]