-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 1.19 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (22 loc) · 1.19 KB
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
28
29
30
# base build image
# Pin the build stage to the builder's native platform: the output is a portable
# (architecture-independent) fat jar, so Maven never needs to run under emulation.
# Only the small final JRE stage below fans out per target architecture.
FROM --platform=$BUILDPLATFORM maven:3.9.9-eclipse-temurin-21-jammy AS maven
# copy the project files
COPY ./pom.xml ./pom.xml
# build all dependencies
RUN mvn dependency:go-offline --batch-mode
# copy source files
COPY ./src ./src
# build for release
RUN mvn package --batch-mode --quiet -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Djacoco.skip=true
# final base image
FROM eclipse-temurin:21-jre-jammy
# Build-time metadata as defined at https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.title="OUIDB to JSON publisher" \
org.opencontainers.image.description="Converts the OUI Database to Json and publish to GIT repo" \
org.opencontainers.image.source="https://github.com/jfisbein/ouidb-to-json-publisher"
COPY --from=maven target/ouidb-to-json-publisher-jar-with-dependencies.jar /
ENV DATA='/var/data'
CMD ["java", "-jar", "/ouidb-to-json-publisher-jar-with-dependencies.jar"]