Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/ingestion/tools/toolbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl gettext-base jq gnupg lsb-release && \
rm -rf /var/lib/apt/lists/*

# Node.js (for JWT token generation)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
# Node.js (for JWT token generation). npm is upgraded in place: the one the
# distro package carries lags its own release line, and its bundled dependency
# tree is what the image scan reports.
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g npm@latest && \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="src/ingestion/tools/toolbox/Dockerfile"

if rg -nF 'npm install -g npm@latest' "$file"; then
  echo "Floating npm tag is still present" >&2
  exit 1
fi

rg -nF 'npm install -g npm@12.0.2' "$file"

Repository: constructorfabric/insight

Length of output: 235


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="src/ingestion/tools/toolbox/Dockerfile"

echo "== Dockerfile snippet =="
cat -n "$file" | sed -n '1,80p'

echo
echo "== npm version references relevant to toolbox or PR context =="
rg -n "npm(@|[: ]|version|12\.0\.2|latest)" . --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' | sed -n '1,120p'

Repository: constructorfabric/insight

Length of output: 3807


Pin npm to npm@12.0.2.

The Dockerfile comment says the bundled npm dependency tree is important for image scans, but line 13 installs the mutable latest tag. Use an exact npm version and assert the installed version after install.

Proposed fix
-    npm install -g npm@latest && \
+    npm install -g npm@12.0.2 && \
+    test "$(npm --version)" = "12.0.2" && \
     npm cache clean --force && \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ingestion/tools/toolbox/Dockerfile` at line 13, Update the Dockerfile’s
global npm installation command to pin npm to exactly version 12.0.2 instead of
latest, then add a verification step that asserts the installed npm version
matches 12.0.2.

npm cache clean --force && \
rm -rf /var/lib/apt/lists/*

# yq (YAML processor)
Expand Down
Loading