Skip to content

Commit 2136e5a

Browse files
Claudeclaude
authored andcommitted
fix: install full Cursor CLI package in clean room container
The Cursor installer puts a complete package (bundled Node 24, index.js, chunk files) under ~/.local/share/cursor-agent/. Previously only the wrapper script was copied, which broke because it couldn't find its bundled node binary. Now copies the entire package to /opt/cursor-agent/ and symlinks it, matching the Claude Code container pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1451bc5 commit 2136e5a

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

testing/clean-room/Dockerfile.cursor

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# GitMem Clean Room — Cursor IDE New User Experience
22
#
33
# Simulates a brand new Cursor user with nothing installed.
4-
# No gitmem, no pre-config — just node + git + .cursor/ directory.
5-
# Mirrors Dockerfile.npm but with Cursor signals instead of Claude Code.
4+
# No gitmem, no pre-config — just node + git + cursor CLI.
5+
# Mirrors Dockerfile.npm but with Cursor instead of Claude Code.
66
#
77
# Build (from gitmem/ root — needs the tarball):
88
# npm pack # creates gitmem-mcp-*.tgz
99
# docker build -t gitmem-cursor -f testing/clean-room/Dockerfile.cursor .
10-
# docker run -it --rm gitmem-cursor
10+
# docker run -it --rm -e CURSOR_API_KEY=$CURSOR_API_KEY gitmem-cursor
1111
#
1212
# Then test exactly what the website says:
1313
# npx gitmem-mcp init
14+
# cursor
1415
#
1516
# Expected: auto-detects Cursor, creates .cursor/mcp.json, .cursorrules, .cursor/hooks.json
1617

@@ -21,18 +22,30 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2122
git \
2223
curl \
2324
jq \
25+
ca-certificates \
2426
&& rm -rf /var/lib/apt/lists/*
2527

28+
# Install Cursor CLI (as root, before user switch)
29+
RUN curl https://cursor.com/install -fsS | bash
30+
2631
# Install gitmem from local tarball (not published npm — contains Cursor changes)
2732
COPY gitmem-mcp-*.tgz /tmp/gitmem-mcp.tgz
2833
RUN npm install -g --loglevel=error /tmp/gitmem-mcp.tgz && rm /tmp/gitmem-mcp.tgz
2934

30-
# No Claude Code installed — this is a Cursor-only environment
31-
3235
# Create non-root developer user with project dir
3336
RUN useradd -m -s /bin/bash developer \
3437
&& mkdir -p /home/developer/my-project \
3538
&& chown developer:developer /home/developer/my-project
39+
40+
# Make Cursor CLI available to developer user.
41+
# The installer puts a full package (bundled Node 24, index.js, chunks) under
42+
# /root/.local/share/cursor-agent/versions/<ver>/. Copy the whole thing to a
43+
# shared location so the non-root user can run it.
44+
RUN CURSOR_DIR=$(readlink -f /root/.local/bin/agent | xargs dirname) \
45+
&& cp -r "$CURSOR_DIR" /opt/cursor-agent \
46+
&& chmod -R a+rX /opt/cursor-agent \
47+
&& ln -s /opt/cursor-agent/cursor-agent /usr/local/bin/cursor
48+
3649
USER developer
3750
WORKDIR /home/developer/my-project
3851

0 commit comments

Comments
 (0)