From 62f153ec8830ac5bfff96a5f269fd371ce3aace1 Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Thu, 21 Sep 2023 13:46:23 +0800 Subject: [PATCH] ci: use new installation instructions for nodejs (#33337) * use new installation instructions for nodejs * more comments * remove apt list in the end --- ci/docker-rust/Dockerfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ci/docker-rust/Dockerfile b/ci/docker-rust/Dockerfile index 07fb9e973..f6d1c5906 100644 --- a/ci/docker-rust/Dockerfile +++ b/ci/docker-rust/Dockerfile @@ -2,12 +2,13 @@ # ci/rust-version.sh to pick up the new image tag FROM rust:1.72.0 +ARG NODE_MAJOR=18 + RUN set -x \ && apt update \ && apt-get install apt-transport-https \ && echo deb https://apt.buildkite.com/buildkite-agent stable main > /etc/apt/sources.list.d/buildkite-agent.list \ && apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32A37959C2FA5C3C99EFBC32A79206696452D198 \ - && curl -fsSL https://deb.nodesource.com/setup_current.x | bash - \ && apt update \ && apt install -y \ buildkite-agent \ @@ -27,9 +28,17 @@ RUN set -x \ protobuf-compiler \ \ && apt remove -y libcurl4-openssl-dev \ - && rm -rf /var/lib/apt/lists/* \ + # node + && sudo apt-get update \ + && sudo apt-get install -y ca-certificates curl gnupg \ + && sudo mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list \ + && sudo apt-get update \ + && sudo apt-get install nodejs -y \ && node --version \ && npm --version \ + # rust && rustup component add rustfmt \ && rustup component add clippy \ && rustup target add wasm32-unknown-unknown \ @@ -42,4 +51,5 @@ RUN set -x \ && cargo install wasm-pack \ && cargo install sccache \ && rustc --version \ - && cargo --version + && cargo --version \ + && rm -rf /var/lib/apt/lists/*