Repository navigation
fix: reduce "openedx" image size and fix Node/npm CVEs - #1557
Open
Faraz32123 wants to merge 2 commits into
Open
Faraz32123 wants to merge 2 commits into
Faraz32123 wants to merge 2 commits into
Conversation
Slim the image by about 600MB and clear every Trivy CRITICAL/HIGH finding in components that Tutor itself installs: - Keep the uv/pip cache out of image layers: build stages share a BuildKit cache mount, and all later stages (production, development, plugin patches) now disable the installer caches entirely, instead of leaking ~380MB into the layers. - Drop the extracted Node tarball from /openedx/nodeenv/src (~200MB): unused at runtime, and it duplicated every npm CVE finding. - Upgrade Node.js 24.22.1 -> 24.22.3 (November 2026 security release) and npm -> 11.21.2, whose vendored undici 6.29.1 and brace-expansion 5.0.12 fix the remaining known vulnerabilities. Part of overhangio#1543 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ahmed-arb
reviewed
Nov 13, 2026
ahmed-arb
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, one fix: the npm self-upgrade should go through NPM_REGISTRY so mirror-only builds don't break.
Comment on lines
172
to
175
| RUN npm install -g npm@11.21.2 | ||
|
|
||
| # Install nodejs requirements | ||
| ARG NPM_REGISTRY={{ NPM_REGISTRY }} |
Collaborator
There was a problem hiding this comment.
Suggested change
| RUN npm install -g npm@11.21.2 | |
| # Install nodejs requirements | |
| ARG NPM_REGISTRY={{ NPM_REGISTRY }} | |
| ARG NPM_REGISTRY={{ NPM_REGISTRY }} | |
| RUN --mount=type=cache,target=/root/.npm,sharing=shared \ | |
| npm install -g npm@11.21.2 --registry=$NPM_REGISTRY | |
| # Install nodejs requirements |
Route the npm self-upgrade through the NPM_REGISTRY build arg and the shared npm cache mount, so builds that rely on a private registry mirror keep working. Addresses review feedback on overhangio#1557. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1543 — the "fix what we own" half, complementing the weekly scan in #1545.
/openedx/nodeenv/src(~200MB).Tested by building
openedxandopenedx-devfrom scratch and running a fulltutor devstack on the result (LMS/CMS healthy), with before/after Trivy scans — testing done with Claude's help.🤖 Generated with Claude Code