Skip to content

Commit 980b001

Browse files
committed
fix(spark-base): Add missing gpg keys in the spark project release keys
1 parent fd92972 commit 980b001

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

spark-base/Dockerfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ ENV SPARK_VERSION ${SPARK_VERSION}
3232
ENV HADOOP_VERSION ${HADOOP_VERSION}
3333
ENV SCALA_VERSION ${SCALA_VERSION}
3434

35+
## Add missing gpg keys from https://downloads.apache.org/spark/KEYS
36+
COPY MISSING-GPG-KEYS.yml .
37+
3538
RUN groupadd --system --gid=${spark_uid} spark && \
3639
useradd --system --uid=${spark_uid} --gid=spark spark
3740

@@ -58,16 +61,19 @@ RUN set -ex;\
5861
curl --retry 3 --retry-all-errors -k ${SPARK_DIST_DOWNLOAD_URL}/${DIST}.tgz -o ${WORK_DIR}/spark.tgz; \
5962
curl --retry 3 --retry-all-errors -k ${SPARK_DIST_DOWNLOAD_URL}/${DIST}.tgz.asc -o ${WORK_DIR}/spark.tgz.asc; \
6063
curl --retry 3 --retry-all-errors -k https://downloads.apache.org/spark/KEYS -o ${WORK_DIR}/KEYS; \
64+
MISSING_KEYS=($(cat MISSING-GPG-KEYS.yml | grep "keys:" -A300 | awk -F: '{ print $2 }' | tr -d '\n' | tr -d \"\" )); \
6165
export GNUPGHOME="$(mktemp -d)"; \
6266
gpg --batch --import ${WORK_DIR}/KEYS; \
67+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys ${MISSING_KEYS} || true; \
68+
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys ${MISSING_KEYS} || true; \
6369
gpg --batch --verify ${WORK_DIR}/spark.tgz.asc ${WORK_DIR}/spark.tgz; \
6470
tar --strip-components=1 -zxvf ${WORK_DIR}/spark.tgz -C ${SPARK_HOME}/; \
6571
chown -R spark:spark ${SPARK_HOME}/; \
6672
mv ${SPARK_HOME}/kubernetes/dockerfiles/spark/decom.sh /opt/; \
6773
mv ${SPARK_HOME}/kubernetes/tests ${SPARK_HOME}/; \
6874
chmod a+x /opt/decom.sh; \
6975
gpgconf --kill all; \
70-
rm -rf ${GNUPGHOME} ${WORK_DIR}; \
76+
rm -rf ${GNUPGHOME} ${WORK_DIR} MISSING-GPG-KEYS.yml; \
7177
rm -fr ${SPARK_HOME}/conf rm -fr ${SPARK_HOME}/yarn rm -fr ${SPARK_HOME}/kubernetes
7278

7379
COPY entrypoint.sh /opt/entrypoint.sh

spark-base/MISSING-GPG-KEYS.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Some gpg keys are missing in the spark project release key https://downloads.apache.org/spark/KEYS
19+
## We add them manually thanks to apache/spark-docker official images repo:
20+
#### https://github.com/apache/spark-docker/blob/master/tools/template.py
21+
keys:
22+
# issuer "yumwang@apache.org"
23+
- "3.3.1": "86727D43E73A415F67A0B1A14E68B3E6CD473653"

0 commit comments

Comments
 (0)