guan404ming commented on code in PR #70285: URL: https://github.com/apache/airflow/pull/70285#discussion_r3638769957
########## scripts/docker/install_os_dependencies.sh: ########## @@ -420,6 +421,33 @@ https://packages.adoptium.net/artifactory/deb ${DISTRO_CODENAME} main" \ rm -rf /var/lib/apt/lists/* } +function install_nodejs() { + local arch + arch="$(dpkg --print-architecture)" + declare -A nodejs_targets=( + [amd64]="linux-x64" + [arm64]="linux-arm64" + ) + declare -A nodejs_sha256s=( + # https://nodejs.org/dist/v${NODEJS_VERSION}/SHASUMS256.txt + [amd64]="9749e988f437343b7fa832c69ded82a312e41a03116d766797ac14f6f9eee578" + [arm64]="0294e8b915ab75f92c7513d2fcb830ae06e10684e6c603e99a87dbf8835389c1" + ) + local target="${nodejs_targets[${arch}]}" + local nodejs_sha256="${nodejs_sha256s[${arch}]}" + if [[ -z "${target}" ]]; then + echo "Unsupported architecture for nodejs: ${arch}" + exit 1 + fi + curl --retry 3 --retry-delay 5 \ + "https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-${target}.tar.xz" \ + -o /tmp/nodejs.tar.xz + echo "${nodejs_sha256} /tmp/nodejs.tar.xz" | sha256sum --check + tar -xJf /tmp/nodejs.tar.xz --strip-components=1 -C /usr/local --no-same-owner + rm -f /tmp/nodejs.tar.xz + corepack enable --install-directory /usr/local/bin Review Comment: `corepack enable` seems to only write shims, so pnpm is fetched from the registry rather than baked in and the verified `11.16.0` isn't what `ts-sdk`gets (it pins `[email protected]`). Could add `corepack prepare pnpm@<version> --activate` to cache it in the image. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
