Bläddra i källkod

dockerfile: update nodesource installer (#3487)

* aptos/Dockerfile: update nodesource installer

This is the recommended installation procedure following https://github.com/nodesource/distributions/tree/4f746d991e099f9494b12e275abe1aab21f1ddf0#installation-instructions

* solana/Dockerfile.client: update nodesource installer

This is the recommended installation procedure following https://github.com/nodesource/distributions/tree/4f746d991e099f9494b12e275abe1aab21f1ddf0#installation-instructions

* sui/Dockerfile.base: update nodesource installer

This is the recommended installation procedure following https://github.com/nodesource/distributions/tree/4f746d991e099f9494b12e275abe1aab21f1ddf0#installation-instructions
Csongor Kiss 2 år sedan
förälder
incheckning
2e31789c70
3 ändrade filer med 23 tillägg och 6 borttagningar
  1. 10 1
      aptos/Dockerfile
  2. 11 2
      solana/Dockerfile.client
  3. 2 3
      sui/Dockerfile.base

+ 10 - 1
aptos/Dockerfile

@@ -8,7 +8,16 @@ RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/certs/ca-certifi
 
 # Install nodejs
 # todo(aki): move this into base image?
-RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get update && apt-get install -y nodejs
+RUN apt-get update
+RUN apt-get install -y ca-certificates curl gnupg
+RUN mkdir -p /etc/apt/keyrings
+RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+
+ARG NODE_MAJOR=18
+RUN 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
+
+RUN apt-get update
+RUN apt-get install nodejs -y
 
 WORKDIR /tmp
 

+ 11 - 2
solana/Dockerfile.client

@@ -3,10 +3,19 @@ FROM cli-gen AS cli-export
 FROM const-gen AS const-export
 FROM ghcr.io/wormhole-foundation/solana:1.10.31@sha256:d31e8db926a1d3fbaa9d9211d9979023692614b7b64912651aba0383e8c01bad AS solana
 
+RUN apt-get update
+
 # libudev is needed by spl-token-cli, and ncat is needed by the devnet setup
 # script to be able to signal a health status for tilt
-RUN apt-get update && apt-get install -yq libudev-dev ncat
-RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs
+RUN apt-get install -y libudev-dev ncat ca-certificates curl gnupg
+RUN mkdir -p /etc/apt/keyrings
+RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+
+ARG NODE_MAJOR=18
+RUN 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
+
+RUN apt-get update
+RUN apt-get install nodejs -y
 
 RUN --mount=type=cache,target=/root/.cache \
     cargo install --version =2.0.12 --locked spl-token-cli

+ 2 - 3
sui/Dockerfile.base

@@ -19,9 +19,8 @@ RUN dnf -y update
 RUN dnf -y install jq curl git make
 
 # Update nodejs version from 10.24.0 to 18.x
-RUN dnf remove -y nodejs npm
-RUN curl -sL https://rpm.nodesource.com/setup_18.x | bash -
-RUN dnf install -y nodejs
+RUN yum install https://rpm.nodesource.com/pub_18.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
+RUN yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
 
 COPY --from=sui-node /root/.cargo/bin/sui /bin/sui
 COPY --from=sui-node /root/.cargo/bin/sui-faucet /bin/sui-faucet