fix(docker): install extension dependencies in Dockerfile#37602
fix(docker): install extension dependencies in Dockerfile#37602zhddoge-ai wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Install extension plugin dependencies after copying the extensions directory to fix missing module errors for plugins like feishu. Previously, extensions/*/package.json files were not present during the initial `pnpm install --frozen-lockfile` step, causing extension dependencies to be skipped. This resulted in runtime errors when loading plugins that require external dependencies (e.g., feishu plugin missing @larksuiteoapi/node-sdk). The fix adds a secondary `pnpm install --no-frozen-lockfile` after COPY . . to ensure extension dependencies are installed before building. Fixes #XXXX Co-Authored-By: 赵浩东 <[email protected]> Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Greptile SummaryThis PR fixes a real Docker build issue where extension plugins (e.g. Two issues with the current implementation:
Confidence Score: 3/5
Last reviewed commit: 7877d6d |
Dockerfile
Outdated
| fi; \ | ||
| done | ||
| # Install extension dependencies after copying extensions directory | ||
| RUN pnpm install --no-frozen-lockfile |
There was a problem hiding this comment.
Missing NODE_OPTIONS memory cap
The original pnpm install at line 41 explicitly sets NODE_OPTIONS=--max-old-space-size=2048 with a comment explaining it prevents OOM kills (exit 137) on low-memory Docker hosts. This second install step omits that guard, so it can hit the same memory issue — especially because it re-resolves the full dependency graph on top of what's already installed.
| RUN pnpm install --no-frozen-lockfile | |
| RUN NODE_OPTIONS=--max-old-space-size=2048 pnpm install --no-frozen-lockfile |
Prompt To Fix With AI
This is a comment left during a code review.
Path: Dockerfile
Line: 103
Comment:
**Missing `NODE_OPTIONS` memory cap**
The original `pnpm install` at line 41 explicitly sets `NODE_OPTIONS=--max-old-space-size=2048` with a comment explaining it prevents OOM kills (`exit 137`) on low-memory Docker hosts. This second install step omits that guard, so it can hit the same memory issue — especially because it re-resolves the full dependency graph on top of what's already installed.
```suggestion
RUN NODE_OPTIONS=--max-old-space-size=2048 pnpm install --no-frozen-lockfile
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7877d6ded9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Dockerfile
Outdated
| fi; \ | ||
| done | ||
| # Install extension dependencies after copying extensions directory | ||
| RUN pnpm install --no-frozen-lockfile |
There was a problem hiding this comment.
Keep the second install lockfile-frozen
This new pnpm install --no-frozen-lockfile step allows dependency resolution to proceed even when a workspace manifest and pnpm-lock.yaml are out of sync (the pnpm help text says frozen mode should fail when an update is needed), which means Docker builds can silently pull unreviewed versions instead of failing fast. In practice, any stale extension package.json now produces non-reproducible images that may differ from what CI/tests validated.
Useful? React with 👍 / 👎.
Dockerfile
Outdated
| fi; \ | ||
| done | ||
| # Install extension dependencies after copying extensions directory | ||
| RUN pnpm install --no-frozen-lockfile |
There was a problem hiding this comment.
Apply the same memory cap to the new install step
The file already documents that dependency installs can OOM on low-memory builders and mitigates that by setting NODE_OPTIONS=--max-old-space-size=2048 on the first install, but this newly added install runs without that guard. On constrained hosts, this second workspace install (which is where extension dependencies are now installed) can still be killed with exit 137 and fail the image build.
Useful? React with 👍 / 👎.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
fix(docker): install extension dependencies in Dockerfile
Problem
Extension plugins like feishu failed to load in Docker with module not found errors:
The Dockerfile's initial
pnpm install --frozen-lockfileran before copying theextensions/directory, so extension dependencies were never installed.Solution
Added
pnpm install --no-frozen-lockfileafterCOPY . .to ensure extension dependencies are installed before building.Changes
Testing
/app/extensions/feishu/node_modules/@larksuiteoapiis present in containerImpact
Co-Authored-By: 赵浩dong [email protected]
Co-Authored-By: Claude Sonnet 4.5 [email protected]