@@ -17,25 +17,18 @@ RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
1717 esac \
1818 && set -ex \
1919 # libatomic1 for arm
20- && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr xz-utils libatomic1 --no-install-recommends \
20+ && apt-get update && apt-get install -y ca-certificates curl wget gpgv dirmngr xz-utils libatomic1 --no-install-recommends \
2121 && rm -rf /var/lib/apt/lists/* \
22- # use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
23- && export GNUPGHOME="$(mktemp -d)" \
24- # gpg keys listed at https://github.com/nodejs/node#release-keys
25- && for key in \
26- "${NODE_KEYS[@]}"
27- ; do \
28- { gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \
29- { gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \
30- done \
31- && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
32- && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
33- && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
34- && gpgconf --kill all \
35- && rm -rf "$GNUPGHOME" \
36- && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
22+ && export PUBRING="$(mktemp)" \
23+ && set -exo pipefail \
24+ && curl -fsSLo "$PUBRING" --compressed https://github.com/nodejs/release-keys/raw/HEAD/gpg-only-active-keys/pubring.kbx \
25+ && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
26+ && curl -fsSL --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
27+ | gpgv --keyring="$PUBRING" --output - \
28+ | grep " node-v$NODE_VERSION.tar.xz\$"
29+ | sha256sum -c - \
3730 && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
38- && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
31+ && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" "$PUBRING" \
3932 # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
4033 && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
4134 && apt-mark auto '.*' > /dev/null \
0 commit comments