|
8 | 8 | # Maintainer: The Dev Container spec maintainers |
9 | 9 |
|
10 | 10 | export NODE_VERSION="${VERSION:-"lts"}" |
| 11 | +export PNPM_VERSION="${PNPMVERSION:-"latest"}" |
11 | 12 | export NVM_VERSION="${NVMVERSION:-"latest"}" |
12 | 13 | export NVM_DIR="${NVMINSTALLPATH:-"/usr/local/share/nvm"}" |
13 | 14 | INSTALL_TOOLS_FOR_NODE_GYP="${NODEGYPDEPENDENCIES:-true}" |
|
45 | 46 | exit 1 |
46 | 47 | fi |
47 | 48 |
|
| 49 | +if [ "${ADJUSTED_ID}" = "rhel" ] && [ "${VERSION_CODENAME-}" = "centos7" ]; then |
| 50 | + # As of 1 July 2024, mirrorlist.centos.org no longer exists. |
| 51 | + # Update the repo files to reference vault.centos.org. |
| 52 | + sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo |
| 53 | + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo |
| 54 | + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo |
| 55 | +fi |
| 56 | + |
48 | 57 | # Setup INSTALL_CMD & PKG_MGR_CMD |
49 | 58 | if type apt-get > /dev/null 2>&1; then |
50 | 59 | PKG_MGR_CMD=apt-get |
@@ -370,16 +379,16 @@ if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then |
370 | 379 | fi |
371 | 380 |
|
372 | 381 | # Install pnpm |
373 | | -if bash -c ". '${NVM_DIR}/nvm.sh' && type pnpm >/dev/null 2>&1"; then |
374 | | - echo "pnpm already installed." |
| 382 | +if [ ! -z "${PNPM_VERSION}" ] && [ "${PNPM_VERSION}" = "none" ]; then |
| 383 | + echo "Ignoring installation of PNPM" |
375 | 384 | else |
376 | 385 | if bash -c ". '${NVM_DIR}/nvm.sh' && type npm >/dev/null 2>&1"; then |
377 | 386 | ( |
378 | 387 | . "${NVM_DIR}/nvm.sh" |
379 | 388 | [ ! -z "$http_proxy" ] && npm set proxy="$http_proxy" |
380 | 389 | [ ! -z "$https_proxy" ] && npm set https-proxy="$https_proxy" |
381 | 390 | [ ! -z "$no_proxy" ] && npm set noproxy="$no_proxy" |
382 | | - npm install -g pnpm |
| 391 | + npm install -g pnpm@$PNPM_VERSION --force |
383 | 392 | ) |
384 | 393 | else |
385 | 394 | echo "Skip installing pnpm because npm is missing" |
|
0 commit comments