Skip to content

Commit 243ce4b

Browse files
authored
Update Node.js Dockerfile to install Yarn differently
The Yarn GPG key (6A010C5166006599AA17F08146C2130DFD2497F5) can no longer be fetched from keyservers, it returns "no user ID". So the signature verification fails. So let's just download yarn via npm and simplify this.
1 parent d1d6ddf commit 243ce4b

1 file changed

Lines changed: 2 additions & 23 deletions

File tree

templates/base/e2b.Dockerfile

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
1010
RUN groupadd --gid 1000 node \
1111
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
1212

13-
ENV NODE_VERSION 20.9.0
13+
ENV NODE_VERSION=20.9.0
1414

1515
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
1616
&& case "${dpkgArch##*-}" in \
@@ -55,26 +55,5 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
5555
&& node --version \
5656
&& npm --version
5757

58-
ENV YARN_VERSION 1.22.19
59-
60-
RUN set -ex \
61-
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
62-
&& export GNUPGHOME="$(mktemp -d)" \
63-
&& for key in \
64-
6A010C5166006599AA17F08146C2130DFD2497F5 \
65-
; do \
66-
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
67-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
68-
done \
69-
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
70-
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
71-
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
72-
&& gpgconf --kill all \
73-
&& rm -rf "$GNUPGHOME" \
74-
&& mkdir -p /opt \
75-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
76-
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
77-
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
78-
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
79-
# smoke test
58+
RUN npm install -g yarn@1.22.19 \
8059
&& yarn --version

0 commit comments

Comments
 (0)