fix: support npm global installs in chroot mode#1336
Conversation
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
|
@copilot |
|
@copilot why is /usr mounted as read-only. What are the security justifications behind it? Can you trace the history of the commits and documentation to figure that out? |
The read-only constraint on |
npm install -gfails inside the agent container because/usris mounted read-only (/usr:/host/usr:ro), and npm's default global prefix writes to/usr/local/lib/node_modules/and/usr/local/bin/.Changes
containers/agent/entrypoint.sh: SetNPM_CONFIG_PREFIX=$HOME/.npm-globaland prepend$HOME/.npm-global/bintoPATHin the generated chroot script, redirecting global installs to the writable home volumetests/integration/chroot-package-managers.test.ts: Add test fornpm install -g semver+ binary execution💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.