Skip to content

Commit 4b3c903

Browse files
update pyspark-notebook to java 21 and derby 10.17.1.0 (#2424)
1 parent 31443e4 commit 4b3c903

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

docs/using/specifics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can build a `pyspark-notebook` image with a different `Spark` version by ove
4444

4545
- Spark distribution is defined by the combination of Spark, Hadoop, and Scala versions,
4646
see [Download Apache Spark](https://spark.apache.org/downloads.html) and the [archive repo](https://archive.apache.org/dist/spark/) for more information.
47-
- `openjdk_version`: The version of the OpenJDK (JRE headless) distribution (`17` by default).
47+
- `openjdk_version`: The version of the OpenJDK (JRE headless) distribution (`21` by default).
4848
- This version needs to match the version supported by the Spark distribution used above.
4949
- See [Spark Overview](https://spark.apache.org/docs/latest/#downloading) and [Ubuntu packages](https://packages.ubuntu.com/search?keywords=openjdk).
5050
- `spark_version` (optional): The Spark version to install, for example `3.5.0`.

images/pyspark-notebook/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ USER root
1616
# Spark dependencies
1717
# Default values can be overridden at build time
1818
# (ARGS are in lowercase to distinguish them from ENV)
19-
ARG openjdk_version="17"
19+
ARG openjdk_version="21"
2020

2121
RUN apt-get update --yes && \
2222
apt-get install --yes --no-install-recommends \
@@ -33,6 +33,7 @@ ARG scala_version
3333
# You need to use https://archive.apache.org/dist/spark/ website if you want to download old Spark versions
3434
# But it seems to be slower, that's why we use the recommended site for download
3535
ARG spark_download_url="https://dlcdn.apache.org/spark/"
36+
ARG derby_version="10.17.1.0"
3637

3738
ENV SPARK_HOME=/usr/local/spark
3839
ENV PATH="${PATH}:${SPARK_HOME}/bin"
@@ -47,6 +48,16 @@ RUN /opt/setup-scripts/setup_spark.py \
4748
--scala-version="${scala_version}" \
4849
--spark-download-url="${spark_download_url}"
4950

51+
# Spark bundles Derby 10.16.1.1 by default; replace it with a fixed release.
52+
RUN set -eux; \
53+
derby_jar="$(find "${SPARK_HOME}/jars" -maxdepth 1 -type f -name 'derby-*.jar' | head -n 1)"; \
54+
test -n "${derby_jar}"; \
55+
derby_dir="$(dirname "${derby_jar}")"; \
56+
curl -fsSL -o "/tmp/derby-${derby_version}.jar" \
57+
"https://repo1.maven.org/maven2/org/apache/derby/derby/${derby_version}/derby-${derby_version}.jar"; \
58+
rm -f "${derby_jar}"; \
59+
mv "/tmp/derby-${derby_version}.jar" "${derby_dir}/"
60+
5061
# Configure IPython system-wide
5162
COPY ipython_kernel_config.py "/etc/ipython/"
5263
RUN fix-permissions "/etc/ipython/"

0 commit comments

Comments
 (0)