Created
March 13, 2019 12:05
-
-
Save amolpednekar/56d572ab346a0d320a6e06ea25438ceb to your computer and use it in GitHub Desktop.
Multi-stage docker build - JVM
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
# Stage 1 (to create a "build" image, ~140MB) | |
FROM maven:3.5-jdk-8-alpine AS builder | |
COPY . /usr/src/todolist-spring-boot-backend/ | |
WORKDIR /usr/src/todolist-spring-boot-backend/ | |
RUN mvn package | |
# Stage 2 (to create a downsized "container executable", ~87MB) | |
FROM openjdk:8-jre-alpine3.7 | |
WORKDIR /root/ | |
COPY --from=builder /usr/src/todolist-spring-boot-backend/target/todoapp-0.0.1-SNAPSHOT.jar . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment