From 7120f55ff61c3349ae9826e83cb6da46ddc28d0f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 12 Dec 2023 10:29:14 +0100 Subject: [PATCH] ci(local-node): replace deprecated node setup (#642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ As in commit 33174aa59 and `docker/zk-environment/Dockerfile` use the repo to setup node, instead of the `curl | sh`. ## Why ❔ The old method is deprecated and it saves one minute waiting time instead of the deprecation banner being displayed. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `cargo spellcheck --cfg=./spellcheck/era.cfg --code 1`. Signed-off-by: Harald Hoyer --- docker/local-node/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/local-node/Dockerfile b/docker/local-node/Dockerfile index 3fe18d14d911..e8ad464a46c3 100644 --- a/docker/local-node/Dockerfile +++ b/docker/local-node/Dockerfile @@ -6,12 +6,15 @@ WORKDIR / # Install required dependencies RUN apt-get update; apt-get install -y make bash git openssl libssl-dev gcc g++ curl pkg-config software-properties-common jq wget -RUN apt-get install -y libpq5 ca-certificates postgresql-client && rm -rf /var/lib/apt/lists/* +RUN apt-get install -y curl gnupg libpq5 ca-certificates postgresql-client && rm -rf /var/lib/apt/lists/* # Install node and yarn -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - -RUN apt-get install -y nodejs -RUN npm install -g yarn +ENV NODE_MAJOR=18 +RUN mkdir -p /etc/apt/keyrings && \ + wget -c -O - 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.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ + apt-get update && apt-get install nodejs -y && \ + npm install -g yarn # Copy compiler (both solc and zksolc) binaries # Obtain `solc` 0.8.12.