From 07ec0854c389b3c318be2d89b499aa309286cf64 Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Mon, 24 Mar 2025 14:00:49 +0100 Subject: [PATCH] Only install npm through APT when node version is under 20 --- ci/build/Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/build/Dockerfile b/ci/build/Dockerfile index 8bdb3c5..2be5624 100644 --- a/ci/build/Dockerfile +++ b/ci/build/Dockerfile @@ -50,7 +50,6 @@ RUN apt-get update && \ make \ libtool \ nodejs \ - npm \ gnupg \ zip \ bc \ @@ -82,6 +81,13 @@ RUN apt-get update && \ php${PHP_VERSION}-zip \ && rm -rf /var/lib/apt/lists/* +# Only install npm if node version is less than 20, otherwise it's already installed +RUN if [ "${NODE_VERSION}" -lt 20 ]; then \ + apt-get update \ + && apt-get install -y --no-install-recommends npm \ + && rm -rf /var/lib/apt/lists/*; \ + fi + COPY ./.git /hypernode/.git COPY ./bin /hypernode/bin COPY ./ci /hypernode/ci