-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.maven-multistage
23 lines (16 loc) · 1.1 KB
/
Dockerfile.maven-multistage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ----------------------------------------------------------------------------------------------------------------------
# maven:latest as of October 26, 2024
# ----------------------------------------------------------------------------------------------------------------------
FROM docker.io/library/maven@sha256:440a97a9304d5f66cb96e01161724d0ac3a50d1d90c4cb99dffd94fe4282d31f AS builder
WORKDIR /work
COPY src/ src/
COPY pom.xml pom.xml
RUN mvn clean package
RUN REPOSITORY=$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout) && rm -rf ${REPOSITORY}
# ----------------------------------------------------------------------------------------------------------------------
# eclipse-temurin:23 as of October 26, 2024
# ----------------------------------------------------------------------------------------------------------------------
FROM docker.io/library/eclipse-temurin:23-jre@sha256:892bc93de848e69ba4669b0c1a4c7171ffe086211d90bee33ec3c332c3c52be6 AS runner
WORKDIR /app
COPY --from=builder /work/target/java-demo-app-1.0.0.jar .
ENTRYPOINT ["java", "-jar", "java-demo-app-1.0.0.jar"]