From 393b0034993bec368f2e867800cc7d39cd4466a9 Mon Sep 17 00:00:00 2001 From: Jan Makara Date: Mon, 26 Aug 2024 16:33:24 +0200 Subject: [PATCH] update dockerfiles to install node via apt-get --- Dockerfile | 14 +++++--------- Dockerfile.unix | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25c11f8..295239f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,13 @@ ARG RUBY_VERSION=3.3.4 FROM ruby:${RUBY_VERSION} -ARG NODE_VERSION=v22.6.0 +ARG NODE_VERSION=22 ARG YARN_VERSION=1.22.22 -RUN curl -fsSL https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz \ - -o /tmp/node-$NODE_VERSION-linux-x64.tar.gz \ - && tar -xzvf /tmp/node-$NODE_VERSION-linux-x64.tar.gz -C /usr/local \ - && rm -rf /tmp/node-$NODE_VERSION-linux-x64.tar.gz - -ENV PATH=/usr/local/node-$NODE_VERSION-linux-x64/bin:$PATH - -RUN npm install -g yarn@$YARN_VERSION +RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ + && apt-get update \ + && apt-get install --yes --no-install-recommends nodejs \ + && npm install -g yarn@$YARN_VERSION ARG RAILS_VERSION # Install Rails based on the version specified but if not specified, install the latest version. diff --git a/Dockerfile.unix b/Dockerfile.unix index 36335ba..0c2eefa 100644 --- a/Dockerfile.unix +++ b/Dockerfile.unix @@ -5,17 +5,13 @@ ARG USER_ID=1000 ARG GROUP_ID=1000 RUN groupadd -g $GROUP_ID app && useradd -u $USER_ID -g app -m app -ARG NODE_VERSION=v22.6.0 +ARG NODE_VERSION=22 ARG YARN_VERSION=1.22.22 -RUN curl -fsSL https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz \ - -o /tmp/node-$NODE_VERSION-linux-x64.tar.gz \ - && tar -xzvf /tmp/node-$NODE_VERSION-linux-x64.tar.gz -C /usr/local \ - && rm -rf /tmp/node-$NODE_VERSION-linux-x64.tar.gz - -ENV PATH=/usr/local/node-$NODE_VERSION-linux-x64/bin:$PATH - -RUN npm install -g yarn@$YARN_VERSION +RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ + && apt-get update \ + && apt-get install --yes --no-install-recommends nodejs \ + && npm install -g yarn@$YARN_VERSION USER app