From d51b0d30756659c5246cfffcbe8f98c81cdade82 Mon Sep 17 00:00:00 2001 From: Michael Baudino Date: Wed, 24 Apr 2024 09:22:26 +0200 Subject: [PATCH] Bump Node version from 16.x LTS to 20.x LTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … and use the new Nodesource `nodistro` distribution via their install script (which is their recommended installation method… again 😅). This commit also bumps Gosu from 1.16 to 1.17. --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index d147834..b71decd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,9 @@ ARG RUBYGEMS_VERSION_ARG="" \ BUNDLER_VERSION_ARG="" # Define dependencies base versions -ENV NODE_VERSION="16" \ - GOSU_VERSION="1.16" +# Note: NodeJS is capped to 14.x on Jessie and 16.x on Stretch (due to `libc` requirements) +ENV NODE_VERSION="20" \ + GOSU_VERSION="1.17" # Define some default variables ENV PORT="5000" \ @@ -95,11 +96,11 @@ RUN set -eux; \ esac > /etc/apt/sources.list.d/pgdg.list; \ \ # Add NodeJS APT repository - curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/apt.nodesource.com.gpg; \ case ${debianReleaseCodename} in \ - jessie) echo "deb https://deb.nodesource.com/node_14.x ${debianReleaseCodename} main" ;; \ - *) echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x ${debianReleaseCodename} main" ;; \ - esac > /etc/apt/sources.list.d/nodesource.list; \ + jessie) curl -fsSL https://deb.nodesource.com/setup_14.x ;; \ + stretch) curl -fsSL https://deb.nodesource.com/setup_16.x ;; \ + *) curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x ;; \ + esac | bash; \ \ # Install everything apt-get update; \ @@ -124,7 +125,7 @@ RUN set -eux; \ esac; # Install `gosu` -ARG TARGETARCH +ARG TARGETARCH # provided by Docker multi-platform support: https://docs.docker.com/build/guide/multi-platform RUN set -eux; \ osType="$(sed -n 's|^ID=||p' /etc/os-release)"; \ export GNUPGHOME="$(mktemp -d)"; \