huanbao commited on
Commit
067b22c
·
verified ·
1 Parent(s): 66c7817

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -20,9 +20,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
20
  RUN npm install -g @anthropic-ai/claude-code @cloudcli-ai/cloudcli task-master-ai pnpm \
21
  && npm cache clean --force
22
 
23
- # 2. 关键:直接将 cli.js 里的 root uid 检查干掉
24
- RUN FILE=$(find /usr/local -name "cli.js" 2>/dev/null | grep claude-code) && \
25
- sed -i 's/process\.getuid() === 0/false/g' "$FILE"
 
26
 
27
  # 3. 安装官方 Cursor CLI,并使用【软链接】暴露到全局 PATH(保持 index.js 相对路径不破坏)
28
  RUN curl -fsSL https://cursor.com/install | bash && \
 
20
  RUN npm install -g @anthropic-ai/claude-code @cloudcli-ai/cloudcli task-master-ai pnpm \
21
  && npm cache clean --force
22
 
23
+ # 2. 精准定位 cli.js 并去除 root 权限退出逻辑
24
+ RUN CLI_PATH=$(node -e 'console.log(require("path").dirname(require.resolve("@anthropic-ai/claude-code/package.json")) + "/cli.js")') && \
25
+ sed -i 's/cannot be used with root\/sudo privileges for security reasons/bypass root/g' "$CLI_PATH" && \
26
+ sed -i 's/process\.exit(1)/ /* bypass */ /g' "$CLI_PATH"
27
 
28
  # 3. 安装官方 Cursor CLI,并使用【软链接】暴露到全局 PATH(保持 index.js 相对路径不破坏)
29
  RUN curl -fsSL https://cursor.com/install | bash && \