12345678910111213141516171819202122232425
FROM gradle:jdk20 as builderWORKDIR /appADD *.gradle gradle.* gradlew ./RUN --mount=type=cache,target=/root/.gradle \gradle --no-daemon build || trueADD ./src ./srcRUN --mount=type=cache,target=/root/.gradle \gradle --no-daemon bootJar# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~FROM openjdk:19COPY --from=builder /app/build/libs/*.jar /app.jarCMD java -jar /app.jar