From 3953b92eacaf4ac387e05f00d72311b0d8a19a4f Mon Sep 17 00:00:00 2001 From: eastagiletracker <310448263+eastagiletracker@users.noreply.github.com> Date: Thu, 20 Aug 2026 15:37:08 +0700 Subject: [PATCH] run the NodeSource setup script as root The image is meant to ship the Node version the Dockerfile names, but it ships Ubuntu's nodejs 18.19.1 and no npm at all. The setup script is piped into bash as the unprivileged runner user, so it cannot write apt's lists: E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ Error: Failed to run 'apt update' (Exit Code: 0) The script still exits 0, so the && chain continues and apt-get install -y nodejs is satisfied by the distro package instead. The NodeSource repo has therefore never been configured, and 70b05ff bumping setup_20.x to setup_24.x changed nothing about the image. Pipe to sudo -E bash - per NodeSource's documented install, and assert node and npm afterwards so the layer fails loudly instead of silently installing the wrong runtime, matching the version checks the other install layers already run. --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3f51ef..bb7265a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,10 @@ ARG HELM_DIFF_VERSION=3.12.2 RUN sudo apt-get update && \ sudo apt-get install -y git unzip zip jq openssh-client curl git-lfs perl && \ sudo apt-get clean && \ - curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \ - sudo apt-get install -y nodejs + curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - && \ + sudo apt-get install -y nodejs && \ + node --version && \ + npm --version # Install Python 3.11 and pip3 securely RUN sudo apt-get update && \