Skip to content

Commit 63b7cb3

Browse files
authored
fix(spark): remove the JRE before installing the JDK (#1410)
* fix(spark): remove the JRE before installing the JDK * english
1 parent 521605a commit 63b7cb3

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ All notable changes to this project will be documented in this file.
5353
- zookeeper: Remove `3.9.3` ([#1401]).
5454
- trino: Remove `451` and `476` ([#1403]).
5555
- hbase: Remove `2.6.2` ([#1408]).
56+
- spark: remove the JRE before installing the JDK to prevent version conflicts ([#1410]).
5657

5758
### Fixed
5859

@@ -87,6 +88,7 @@ All notable changes to this project will be documented in this file.
8788
[#1406]: https://github.com/stackabletech/docker-images/pull/1406
8889
[#1408]: https://github.com/stackabletech/docker-images/pull/1408
8990
[#1409]: https://github.com/stackabletech/docker-images/pull/1409
91+
[#1410]: https://github.com/stackabletech/docker-images/pull/1410
9092

9193
## [25.11.0] - 2025-11-07
9294

spark-k8s/Dockerfile.3

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ chmod -R g=u /stackable/spark-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}/ass
176176
chmod -R g=u /stackable/jmx
177177
EOF
178178

179-
# TODO: java-base installs the Adoptium dnf repo and the Termurin jre which is not needed here.
180-
# To reduce the size of this image, the Adoptium repo could be moved to stackable-base instead.
181179
FROM local-image/java-base AS final
182180

183181
ARG PRODUCT_VERSION
@@ -218,6 +216,11 @@ COPY --chown=${STACKABLE_USER_UID}:0 spark-k8s/licenses /licenses
218216
RUN <<EOF
219217
microdnf update
220218

219+
# Remove the JRE that was installed by local-image/java-base.
220+
# The JRE is not enough for Spark because some functionality requires the JDK.
221+
# Also having both JRE and JDK installed causes conflicts with Java 21 because they have slightly different versions in the Adoptium repository.
222+
microdnf remove "temurin-${JAVA_VERSION}-jre"
223+
221224
# procps:
222225
# Required for spark startup scripts.
223226
# temurin-{version}-jdk:

spark-k8s/Dockerfile.4

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ chmod -R g=u /stackable/spark-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}/ass
150150
chmod -R g=u /stackable/jmx
151151
EOF
152152

153-
# TODO: java-base installs the Adoptium dnf repo and the Termurin jre which is not needed here.
154-
# To reduce the size of this image, the Adoptium repo could be moved to stackable-base instead.
155153
FROM local-image/java-base AS final
156154

157155
ARG PRODUCT_VERSION
@@ -190,6 +188,11 @@ COPY --chown=${STACKABLE_USER_UID}:0 spark-k8s/licenses /licenses
190188
RUN <<EOF
191189
microdnf update
192190

191+
# Remove the JRE that was installed by local-image/java-base.
192+
# The JRE is not enough for Spark because some functionality requires the JDK.
193+
# Also having both JRE and JDK installed causes conflicts with Java 21 because they have slightly different versions in the Adoptium repository.
194+
microdnf remove "temurin-${JAVA_VERSION}-jre"
195+
193196
# procps:
194197
# Required for spark startup scripts.
195198
# temurin-{version}-jdk:

0 commit comments

Comments
 (0)