-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
27 lines (21 loc) · 1.06 KB
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#--------------------------------------------------------------------------------------------------
# Builder image
#--------------------------------------------------------------------------------------------------
FROM docker.io/library/maven:3.8-eclipse-temurin-11-alpine as builder
WORKDIR /workspace/app
COPY pom.xml .
COPY src src
ARG APP_VERSION=1.0.0
RUN mvn versions:set -DnewVersion=$APP_VERSION && \
mvn install -DskipTests && \
mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
#--------------------------------------------------------------------------------------------------
# Application image
#--------------------------------------------------------------------------------------------------
FROM docker.io/library/eclipse-temurin:11-jre-alpine
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/target/dependency
COPY --from=builder ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=builder ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","io.todos.WebUI"]