@@ -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 \
@@ -38,6 +41,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
3841 && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
3942 && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
4043 && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
44+ && gpgconf --kill all \
45+ && rm -rf "$GNUPGHOME" \
4146 && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$ " SHASUMS256.txt | sha256sum -c - \
4247 && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4348 && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
@@ -61,6 +66,8 @@ RUN set -ex \
6166 && savedAptMark="$(apt-mark showmanual)" \
6267 && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
6368 && rm -rf /var/lib/apt/lists/* \
69+ # use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
70+ && export GNUPGHOME="$(mktemp -d)" \
6471 && for key in \
6572 6A010C5166006599AA17F08146C2130DFD2497F5 \
6673 ; do \
@@ -70,6 +77,8 @@ RUN set -ex \
7077 && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
7178 && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
7279 && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
80+ && gpgconf --kill all \
81+ && rm -rf "$GNUPGHOME" \
7382 && mkdir -p /opt \
7483 && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
7584 && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
0 commit comments