fix: use npm ci with package-lock.json in Dockerfile#640
fix: use npm ci with package-lock.json in Dockerfile#640webdevpraveen wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
The runtime stage copies nemoclaw/package.json into /opt/nemoclaw/ but omits nemoclaw/package-lock.json, then runs 'npm install --omit=dev'. Without the lockfile npm resolves dependencies from the registry at build time. Two docker builds from the same Git commit can install different transitive dependency versions if any package is updated between runs — producing non-reproducible images. Fix: copy nemoclaw/package-lock.json alongside package.json and replace 'npm install' with 'npm ci'. npm ci reads the lockfile, installs exactly the pinned versions, and fails fast if package.json and package-lock.json drift out of sync. Signed-off-by: Praveen Singh <pr4veensingh@proton.me>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Dockerfile is updated to copy both Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment Tip CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the |
|
Flagging for maintainer review - happy to address any feedback. |
Problem
The runtime stage in
Dockerfilecopiesnemoclaw/package.jsonintothe image but omits
nemoclaw/package-lock.json, then runsnpm install --omit=dev.Without the lockfile,
npm installresolves dependencies from theregistry at build time. Two
docker buildruns from the same Gitcommit can produce images with different transitive dependency versions
if any upstream package is updated between runs — non-reproducible
builds.
Fix
nemoclaw/package-lock.jsoninto the image — it exists inthe repo but was never passed to Docker.
npm installwithnpm ci— reads the lockfileexclusively, installs exactly pinned versions, and exits non-zero if
package.jsonandpackage-lock.jsondrift out of sync.The
RUN npm install -g openclaw@2026.3.11global install line isintentionally unchanged — it installs a pinned external package and
does not use a local lockfile.
References
Summary by CodeRabbit