-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (71 loc) · 2.83 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -----------------------------------------------------------------------------
# Create the DEB package for AMD64
FROM --platform=amd64 docker.io/library/eclipse-temurin:23-jdk-noble as builder-amd64
RUN apt update && apt install -y fakeroot && apt clean
WORKDIR /work
RUN /opt/java/openjdk/bin/jlink \
--add-modules java.base,java.instrument \
--strip-debug \
--compress zip-0 \
--no-header-files \
--no-man-pages \
--output /work/jlink-jre
COPY /target/${project.build.finalName}.jar /work/jpackage-input/
COPY /debian/${project.artifactId}.service /work/jpackage-input/
COPY LICENSE /work/
COPY /debian/postinst /work/jpackage-resources/
COPY /debian/postrm /work/jpackage-resources/
RUN /opt/java/openjdk/bin/jpackage \
--type deb \
--runtime-image /work/jlink-jre \
--name "${project.name}" \
--vendor "${project.developers[0].name}" \
--copyright "${project.developers[0].name}" \
--about-url "https://github.com/Jurrie/xremote-proxy/" \
--license-file "/work/LICENSE" \
--app-version "${project.version}" \
--linux-deb-maintainer "${project.developers[0].email}" \
--linux-package-deps "libsystemd0" \
--description "${project.description}" \
--main-jar "${project.build.finalName}.jar" \
--input "/work/jpackage-input" \
--dest "/work/output" \
--resource-dir "/work/jpackage-resources"
# -----------------------------------------------------------------------------
# Create the DEB package for ARM64
FROM --platform=arm64 docker.io/library/eclipse-temurin:23-jdk-noble as builder-arm64
RUN apt update && apt install -y fakeroot && apt clean
WORKDIR /work
RUN /opt/java/openjdk/bin/jlink \
--add-modules java.base,java.instrument \
--strip-debug \
--compress zip-0 \
--no-header-files \
--no-man-pages \
--output /work/jlink-jre
COPY /target/${project.build.finalName}.jar /work/jpackage-input/
COPY /debian/${project.artifactId}.service /work/jpackage-input/
COPY LICENSE /work/
COPY /debian/postinst /work/jpackage-resources/
COPY /debian/postrm /work/jpackage-resources/
RUN /opt/java/openjdk/bin/jpackage \
--type deb \
--runtime-image /work/jlink-jre \
--name "${project.name}" \
--vendor "${project.developers[0].name}" \
--copyright "${project.developers[0].name}" \
--about-url "https://github.com/Jurrie/xremote-proxy/" \
--license-file "/work/LICENSE" \
--app-version "${project.version}" \
--linux-deb-maintainer "${project.developers[0].email}" \
--linux-package-deps "libsystemd0" \
--description "${project.description}" \
--main-jar "${project.build.finalName}.jar" \
--input "/work/jpackage-input" \
--dest "/work/output" \
--resource-dir "/work/jpackage-resources"
# -----------------------------------------------------------------------------
# Output the DEB packages
FROM scratch as output
COPY --from=builder-amd64 /work/output/ .
COPY --from=builder-arm64 /work/output/ .