-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile
35 lines (23 loc) · 967 Bytes
/
Dockerfile
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
31
32
33
34
35
# syntax=docker/dockerfile:1.4
# Set Java versions
ARG JAVA_VERSION=17
# Use Maven eclipse Temurin based
FROM maven:3.8-eclipse-temurin-$JAVA_VERSION as build
ARG TOOLS_JAVA_VERSION=1.1.5-SNAPSHOT
WORKDIR /build
# BUILD
RUN --mount=type=cache,target=/root/.m2 \
--mount=type=bind,source=$PWD,target=/build,rw \
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install \
&& mkdir -p /usr/lib/java/spdx \
&& cp target/tools-java-$TOOLS_JAVA_VERSION-jar-with-dependencies.jar /usr/lib/java/spdx/
# Configure the wrapper script
COPY scripts/tools-java-wrapper.sh /usr/bin/tools-java
# Make the bwrapper match tools version
RUN sed -i "s/@@VERSION@@/$TOOLS_JAVA_VERSION/g" /usr/bin/tools-java \
&& chmod +x /usr/bin/tools-java
# Deploy image
FROM eclipse-temurin:$JAVA_VERSION as run
COPY --from=build /usr/lib/java/spdx /usr/lib/java/spdx
COPY --from=build /usr/bin/tools-java /usr/bin/tools-java
ENTRYPOINT [ "/usr/bin/tools-java" ]