./gradlew ์ฌ์ฉํด์ ์คํ
https://sangchul.kr/entry/%EC%9B%90%EB%8F%84%EC%9A%B0-Spring-Boot-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-Gradle%EB%A1%9C-Docker-%EC%9D%B4%EB%AF%B8%EC%A7%80-%EB%B9%8C%EB%93%9C%ED%95%98%EA%B8%B0
gradle ์ฌ์ฉํด์ ์คํ
https://tweety1121.tistory.com/entry/Dockerfile-%EB%82%B4%EC%97%90%EC%84%9C-gradle-%EB%B9%8C%EB%93%9C-%ED%9B%84-spring-boot-%EC%9D%B4%EB%AF%B8%EC%A7%80-%EC%83%9D%EC%84%B1-Multi-Stage
์ฐธ๊ณ git
https://gist.github.com/msauza/6a906e879549e218c54868d81161afcb
๊ณต์๋ฌธ์
https://docs.docker.com/build/building/multi-stage/#differences-between-legacy-builder-and-buildkit
FROM gradle:6.9.2-jdk11 AS BUILD
ENV APP_HOME=/app
WORKDIR $APP_HOME
COPY gradle $APP_HOME/gradle
COPY build.gradle settings.gradle gradlew $APP_HOME/
COPY src $APP_HOME/src
USER root
RUN chmod +x gradlew
RUN ./gradlew clean build
# Final Stage
FROM openjdk:11-jre-slim
ENV APP_HOME=/app
ENV JAR_FILE=/app/build/libs/*.jar
WORKDIR $APP_HOME
COPY --from=BUILD ${JAR_FILE} /app.jar
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=${active}", "-Duser.timezone=Asia/Seoul", "/app.jar"]
์ฉ๋ ์ด์๋ก ์ธํด์.... ๋์ปคํ์ผ์ด๋ ํ๋ก์ ํธ๋ฅผ ๋ชจ๋ ๋ฐฐํฌํ๊ณ ํ๋์ง ํด์ผ๊ฒ ๋ค,, ๋จธ๋ฆฌ๊ฐ ๋๋ฌด ์ํ๋ค