Skip to content

Commit 63bec45

Browse files
authored
Merge pull request #1009 from romainx/spark_mirror
Use the preferred spark download mirror
2 parents 2fd8568 + 4333c7c commit 63bec45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyspark-notebook/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ RUN apt-get -y update && \
1515
apt-get install --no-install-recommends -y openjdk-8-jre-headless ca-certificates-java && \
1616
rm -rf /var/lib/apt/lists/*
1717

18+
# Using the preferred mirror to download the file
1819
RUN cd /tmp && \
19-
wget -q http://mirrors.ukfast.co.uk/sites/ftp.apache.org/spark/spark-${APACHE_SPARK_VERSION}/spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz && \
20+
wget -q $(wget -qO- https://www.apache.org/dyn/closer.lua/spark/spark-${APACHE_SPARK_VERSION}/spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz\?as_json | \
21+
python -c "import sys, json; content=json.load(sys.stdin); print(content['preferred']+content['path_info'])") && \
2022
echo "2426a20c548bdfc07df288cd1d18d1da6b3189d0b78dee76fa034c52a4e02895f0ad460720c526f163ba63a17efae4764c46a1cd8f9b04c60f9937a554db85d2 *spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz" | sha512sum -c - && \
2123
tar xzf spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz -C /usr/local --owner root --group root --no-same-owner && \
2224
rm spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz

0 commit comments

Comments
 (0)