Skip to content

Commit ce2f751

Browse files
committed
Initial docker image is added
1 parent 797cb14 commit ce2f751

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# spring-boot-based-microservices
22
WIP revamping existing codebase to support new features
3+
4+
## 1. Docker file - upgrade to java 17 slim image once available
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# stage 1
2+
# Start with a base image containing Java runtime
3+
# TODO :: Upgrade to slim jre version for 17 once available
4+
FROM openjdk:17-alpine as builder
5+
WORKDIR application
6+
ARG JAR_FILE=target/*.jar
7+
COPY ${JAR_FILE} application.jar
8+
RUN java -Djarmode=layertools -jar application.jar extract
9+
10+
# the second stage of our build will copy the extracted layers
11+
FROM openjdk:17-alpine
12+
WORKDIR application
13+
COPY --from=builder application/dependencies/ ./
14+
COPY --from=builder application/spring-boot-loader/ ./
15+
COPY --from=builder application/snapshot-dependencies/ ./
16+
COPY --from=builder application/application/ ./
17+
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]

0 commit comments

Comments
 (0)