Install yarn in tidy dockerfile

This commit is contained in:
Yotam Ofek
2025-11-09 21:59:21 +02:00
parent 8acea59362
commit 3e089f2b3c

View File

@@ -3,8 +3,13 @@
set -ex
NODEJS_VERSION=v20.12.2
YARN_VERSION=1.22.22
INSTALL_PATH=${1:-/node}
url="https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz"
curl -sL "$url" | tar -xJ
mv node-${NODEJS_VERSION}-linux-x64 "${INSTALL_PATH}"
# now, install yarn.
# we call npm through the node binary, because otherwise npm will expect node to be in the PATH
"${INSTALL_PATH}/bin/node" "${INSTALL_PATH}/bin/npm" install --global yarn@${YARN_VERSION}