@@ -19,6 +19,9 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
19
19
# libatomic1 for arm
20
20
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr xz-utils libatomic1 --no-install-recommends \
21
21
&& 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
22
25
&& for key in \
23
26
4ED778F539E3634C779C87C6D7062848A1AB005C \
24
27
141F07595B7B3FFE74309A937405533BE57C7D57 \
@@ -38,6 +41,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
38
41
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
39
42
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
40
43
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
44
+ && gpgconf --kill all \
45
+ && rm -rf "$GNUPGHOME" \
41
46
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$ " SHASUMS256.txt | sha256sum -c - \
42
47
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
43
48
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
@@ -61,6 +66,8 @@ RUN set -ex \
61
66
&& savedAptMark="$(apt-mark showmanual)" \
62
67
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
63
68
&& 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)" \
64
71
&& for key in \
65
72
6A010C5166006599AA17F08146C2130DFD2497F5 \
66
73
; do \
@@ -70,6 +77,8 @@ RUN set -ex \
70
77
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
71
78
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
72
79
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
80
+ && gpgconf --kill all \
81
+ && rm -rf "$GNUPGHOME" \
73
82
&& mkdir -p /opt \
74
83
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
75
84
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
0 commit comments