豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,30 @@
FROM node:lts-alpine

ENV MCP_CLIENT_DOCKER=true
# Create app directory
WORKDIR /usr/src/app

LABEL io.docker.server.metadata='{ \
"name": "desktop-commander", \
"version": "1.0.0", \
"description": "Desktop Commander MCP Server", \
"command": ["node", "dist/index.js"], \
"mounts": [ \
{ \
"source": "/var/run/docker.sock", \
"target": "/var/run/docker.sock", \
"type": "bind" \
}, \
{ \
"source": "/Users/dasein/Documents", \
"target": "/home/Documents", \
"type": "bind" \
} \
] \
}'
Comment on lines +6 to +23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid embedding user-specific host paths in image metadata.

The label currently hardcodes /Users/dasein/Documents, which leaks a real username and is non-portable across hosts/OSes. Consider using a placeholder path and documenting how users should override it. Also, note that mounting the Docker socket grants host‑level control; make sure this is clearly documented as dev‑only/opt‑in.

🛠️ Suggested adjustment
-    { \
-    "source": "/Users/dasein/Documents", \
-    "target": "/home/Documents", \
-    "type": "bind" \
-    } \
+    { \
+    "source": "/path/to/Documents", \
+    "target": "/home/Documents", \
+    "type": "bind" \
+    } \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
LABEL io.docker.server.metadata='{ \
"name": "desktop-commander", \
"version": "1.0.0", \
"description": "Desktop Commander MCP Server", \
"command": ["node", "dist/index.js"], \
"mounts": [ \
{ \
"source": "/var/run/docker.sock", \
"target": "/var/run/docker.sock", \
"type": "bind" \
}, \
{ \
"source": "/Users/dasein/Documents", \
"target": "/home/Documents", \
"type": "bind" \
} \
] \
}'
LABEL io.docker.server.metadata='{ \
"name": "desktop-commander", \
"version": "1.0.0", \
"description": "Desktop Commander MCP Server", \
"command": ["node", "dist/index.js"], \
"mounts": [ \
{ \
"source": "/var/run/docker.sock", \
"target": "/var/run/docker.sock", \
"type": "bind" \
}, \
{ \
"source": "/path/to/Documents", \
"target": "/home/Documents", \
"type": "bind" \
} \
] \
}'
🤖 Prompt for AI Agents
In `@Dockerfile` around lines 6 - 23, The Docker label io.docker.server.metadata
embeds a user-specific host path (/Users/dasein/Documents) and a Docker socket
mount which is non‑portable and leaks sensitive info; replace the hardcoded host
path with a generic placeholder (e.g. "<HOST_DOCUMENTS_PATH>") in the "mounts"
entry and update the label description to instruct users to override that
placeholder when running the image, and add a clear note in the image metadata
or project docs that binding /var/run/docker.sock is a privileged, dev‑only,
opt‑in action; ensure changes are made around the LABEL
io.docker.server.metadata block so consumers can configure mounts at runtime.

# 🔥 INSTALL DOCKER CLI + COMPOSE
RUN apk add --no-cache \
docker-cli \
docker-cli-compose \
bash

# Copy package.json and package-lock.json
COPY package*.json ./
Expand All @@ -20,7 +42,6 @@ COPY . .
# Build the application
RUN npm run build

# Expose port if needed (not specified, so using none)
# Set default command (can be overridden by metadata)
CMD ["node", "dist/index.js"]

# Command to run the server
CMD [ "node", "dist/index.js" ]