@@ -19,6 +19,9 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
1919 # libatomic1 for arm
2020 && apt-get update && apt-get install -y ca-certificates curl wget gnupg 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
2225 && for key in \
2326 4ED778F539E3634C779C87C6D7062848A1AB005C \
2427 141F07595B7B3FFE74309A937405533BE57C7D57 \
@@ -37,6 +40,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
3740 && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
3841 && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
3942 && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
43+ && gpgconf --kill all \
44+ && rm -rf "$GNUPGHOME" \
4045 && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$ " SHASUMS256.txt | sha256sum -c - \
4146 && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4247 && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
@@ -60,6 +65,8 @@ RUN set -ex \
6065 && savedAptMark="$(apt-mark showmanual)" \
6166 && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
6267 && rm -rf /var/lib/apt/lists/* \
68+ # use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
69+ && export GNUPGHOME="$(mktemp -d)" \
6370 && for key in \
6471 6A010C5166006599AA17F08146C2130DFD2497F5 \
6572 ; do \
@@ -69,6 +76,8 @@ RUN set -ex \
6976 && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
7077 && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
7178 && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
79+ && gpgconf --kill all \
80+ && rm -rf "$GNUPGHOME" \
7281 && mkdir -p /opt \
7382 && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
7483 && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
0 commit comments