Commit 123316b 1 parent 243b085 commit 123316b Copy full SHA for 123316b
File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 17
17
# under the License.
18
18
#
19
19
20
+ FROM eclipse-temurin:17 as jre-build
21
+
22
+ # Create a custom Java runtime
23
+ RUN $JAVA_HOME/bin/jlink \
24
+ --add-modules ALL-MODULE-PATH \
25
+ --strip-debug \
26
+ --no-man-pages \
27
+ --no-header-files \
28
+ --compress=2 \
29
+ --output /javaruntime
30
+
31
+ RUN echo networkaddress.cache.ttl=1 >> /javaruntime/conf/security/java.security
32
+ RUN echo networkaddress.cache.negative.ttl=1 >> /javaruntime/conf/security/java.security
33
+
20
34
FROM ubuntu:22.04
21
35
MAINTAINER Apache BookKeeper <
[email protected] >
22
36
@@ -42,7 +56,6 @@ RUN set -x \
42
56
&& adduser "${BK_USER}" \
43
57
&& apt-get update \
44
58
&& apt-get install -y ca-certificates apt-transport-https \
45
- && apt-get install -y --no-install-recommends openjdk-17-jdk \
46
59
&& apt-get install -y --no-install-recommends python3 pip \
47
60
&& ln -s /usr/bin/python3 /usr/bin/python \
48
61
&& apt-get install -y --no-install-recommends gpg gpg-agent wget sudo \
@@ -66,10 +79,9 @@ RUN set -x \
66
79
67
80
WORKDIR /opt/bookkeeper
68
81
69
- ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-$TARGETARCH
70
-
71
- RUN echo networkaddress.cache.ttl=1 >> $JAVA_HOME/conf/security/java.security \
72
- && echo networkaddress.cache.negative.ttl=1 >> $JAVA_HOME/conf/security/java.security
82
+ ENV JAVA_HOME=/opt/java/openjdk
83
+ ENV PATH="$PATH:$JAVA_HOME/bin"
84
+ COPY --from=jre-build /javaruntime $JAVA_HOME
73
85
74
86
COPY scripts /opt/bookkeeper/scripts
75
87
RUN chmod +x -R /opt/bookkeeper/scripts/
You can’t perform that action at this time.
0 commit comments