-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.maven-multistage-cg-dev
More file actions
23 lines (16 loc) · 1.11 KB
/
Dockerfile.maven-multistage-cg-dev
File metadata and controls
23 lines (16 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ----------------------------------------------------------------------------------------------------------------------
# Chainguard maven@latest as of October 26, 2024
# ----------------------------------------------------------------------------------------------------------------------
FROM cgr.dev/chainguard/maven@sha256:e72defd95ddd4b21a16099c69ca235f54e2b3db9ad17dc0d3f6b3b88137126b4 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}
# ----------------------------------------------------------------------------------------------------------------------
# Chainguard jre@latest-dev as of October 26, 2024 (JDK 23)
# ----------------------------------------------------------------------------------------------------------------------
FROM cgr.dev/chainguard/jre@sha256:08de7ab60f36f618aeca33d9f10f5b8a59dee5bf57f1ec7a1f0d497a2e681410 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"]