From 9c9cac4288ef7bc5557bcfbe8112a39279a4b769 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Thu, 16 Nov 2023 12:15:43 +0000 Subject: [PATCH] Update Node.js install steps setup_xx.x is deprecated now. Use deb package directly instead. --- builders/wasm32-unknown-emscripten/Dockerfile | 8 +++++++- builders/wasm32-unknown-wasi/Dockerfile | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/builders/wasm32-unknown-emscripten/Dockerfile b/builders/wasm32-unknown-emscripten/Dockerfile index 5e42dc5698..35148ac156 100644 --- a/builders/wasm32-unknown-emscripten/Dockerfile +++ b/builders/wasm32-unknown-emscripten/Dockerfile @@ -1,9 +1,15 @@ FROM emscripten/emsdk:3.1.31 +ARG NODE_MAJOR_VERSION=20 + RUN set -eux; \ apt-get update; \ apt-get install ruby bison make autoconf git curl build-essential libyaml-dev zlib1g-dev gosu -y; \ - curl -fsSL https://deb.nodesource.com/setup_16.x | bash -; \ + apt-get install -y ca-certificates curl gnupg; \ + mkdir -p /etc/apt/keyrings; \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \ + apt-get update; \ apt-get install nodejs -y; \ apt-get clean; \ rm -r /var/lib/apt/lists/* diff --git a/builders/wasm32-unknown-wasi/Dockerfile b/builders/wasm32-unknown-wasi/Dockerfile index 5f3f30566f..270d6e0056 100644 --- a/builders/wasm32-unknown-wasi/Dockerfile +++ b/builders/wasm32-unknown-wasi/Dockerfile @@ -1,11 +1,16 @@ FROM debian:bullseye ARG WASI_PRESET_ARGS_VERSION=0.1.1 +ARG NODE_MAJOR_VERSION=20 RUN set -eux; \ apt-get update; \ apt-get install ruby bison make autoconf git curl build-essential libyaml-dev zlib1g-dev gosu -y; \ - curl -fsSL https://deb.nodesource.com/setup_16.x | bash -; \ + apt-get install -y ca-certificates curl gnupg; \ + mkdir -p /etc/apt/keyrings; \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \ + apt-get update; \ apt-get install nodejs -y; \ apt-get clean; \ rm -r /var/lib/apt/lists/*