From 54b960254cc6712198e5797a95aec67a5bb36b03 Mon Sep 17 00:00:00 2001 From: Masahito Osako <43847020+m11o@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:53:52 +0900 Subject: [PATCH] Update new nodejs installation method for Dockerfile (#30) Because the traditional `setup_XX.x` script is deprecated, and there is a need to migrate to the new installation method. --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 920cbc1..5407971 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,12 @@ FROM ruby:$RUBY_VERSION-slim # Install dependencies RUN apt-get update -qq && apt-get install -y build-essential libvips gnupg2 curl git -# Ensure node.js 18 is available for apt-get -ARG NODE_MAJOR=18 -RUN curl -sL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash - +# Ensure node.js 20 is available for apt-get +ARG NODE_MAJOR=20 +RUN apt-get update && \ + mkdir -p /etc/apt/keyrings && \ + curl --fail --silent --show-error --location 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 # Install node and yarn RUN apt-get update -qq && apt-get install -y nodejs && npm install -g yarn