Skip to content

Commit 144dc44

Browse files
committed
Install yarn in tidy dockerfile
1 parent b9c8fa4 commit 144dc44

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/ci/docker/host-x86_64/tidy/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ COPY scripts/nodejs.sh /scripts/
2828
RUN sh /scripts/nodejs.sh /node
2929
ENV PATH="/node/bin:${PATH}"
3030

31-
# Install eslint
3231
COPY host-x86_64/tidy/eslint.version /tmp/
3332

3433
COPY scripts/sccache.sh /scripts/
@@ -40,7 +39,8 @@ RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-require
4039

4140
COPY host-x86_64/pr-check-1/validate-toolstate.sh /scripts/
4241

43-
RUN bash -c 'npm install -g eslint@$(cat /tmp/eslint.version)'
42+
# Install eslint
43+
RUN bash -c 'yarn global add eslint@$(cat /tmp/eslint.version)'
4444

4545
# NOTE: intentionally uses python2 for x.py so we can test it still works.
4646
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.

src/ci/docker/scripts/nodejs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
set -ex
44

55
NODEJS_VERSION=v20.12.2
6+
YARN_VERSION=1.22.22
67
INSTALL_PATH=${1:-/node}
78

89
url="https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz"
910
curl -sL "$url" | tar -xJ
1011
mv node-${NODEJS_VERSION}-linux-x64 "${INSTALL_PATH}"
12+
13+
# now, install yarn.
14+
# we call npm through the node binary, because otherwise npm will expect node to be in the PATH
15+
"${INSTALL_PATH}/bin/node" "${INSTALL_PATH}/bin/npm" install --global yarn@${YARN_VERSION}

0 commit comments

Comments
 (0)