Skip to content

Commit 81994b8

Browse files
committed
fix: Fix compilation by compiling using Java 17
1 parent 6c1aa60 commit 81994b8

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

hadoop/Dockerfile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1.10.0@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5
22
# check=error=true
33

4-
FROM stackable/image/java-devel AS builder
4+
FROM stackable/image/java-devel AS hadoop-builder
55

66
ARG PRODUCT
77
ARG ASYNC_PROFILER
@@ -95,6 +95,17 @@ ARG HDFS_UTILS
9595
ARG PRODUCT
9696
ARG STACKABLE_USER_UID
9797

98+
# Starting with hdfs-utils 0.4.0 we need to use Java 17 for compilation.
99+
# We can not simply use java-devel with Java 17, as it is also used to compile Hadoop in this
100+
# Dockerfile, which needs Java 11. So we need to also use the java-devel image in version 11 and
101+
# install Java 17 ourselves.
102+
# The adptiom yum repo is already added by the java-devel Dockerfile.
103+
RUN microdnf update && \
104+
microdnf install -y temurin-17-jdk && \
105+
microdnf clean all && \
106+
rm -rf /var/cache/yum
107+
ENV JAVA_HOME="/usr/lib/jvm/temurin-17-jdk"
108+
98109
USER ${STACKABLE_USER_UID}
99110
WORKDIR /stackable
100111

@@ -125,9 +136,9 @@ LABEL name="Apache Hadoop" \
125136
summary="The Stackable image for Apache Hadoop." \
126137
description="This image is deployed by the Stackable Operator for Apache Hadoop / HDFS."
127138

128-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/hadoop-${PRODUCT} /stackable/hadoop-${PRODUCT}/
129-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/
130-
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/async-profiler /stackable/async-profiler/
139+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/hadoop-${PRODUCT} /stackable/hadoop-${PRODUCT}/
140+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/jmx /stackable/jmx/
141+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/async-profiler /stackable/async-profiler/
131142
COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar
132143
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/fuse_dfs_wrapper /stackable/
133144

0 commit comments

Comments
 (0)