dsh-docker
Docker MCP Gateway 管理面板:经 SSH 在远端服务器执行 docker mcp 命令,管理 Docker MCP(列出/部署/移除 profile 中的 MCP、搜索/拉取 Docker MCP Catalog)。免构建(纯 ESM:Host 端 Node 原生 import + spawn python paramiko,Client 端零依赖纯 DOM)。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:somebdly/dsh-docker说明文档
阅读完整 README ↗方式二:手工配置
-
在
~/.dsh/profiles/web/package.json的dependencies增加:"dsh-docker": "file:" -
在
dsh.profile.bundles数组追加dsh-docker -
在
~/.dsh/profiles/web/cordis.patch.yml保留:- insert: - id: dsh-docker name: 'dsh-docker' -
在 profile 目录执行
npm install,重启dsh web
安装后侧边栏出现「Docker」入口,点击打开管理面板。
⚙️ 配置
配置来源优先级:环境变量 > ~/.dsh/dsh-docker/config.json > cordis 行内 config
环境变量
| 环境变量 | 说明 |
|---|---|
MCPGW_SSH_HOST | SSH 主机 |
MCPGW_SSH_PORT | SSH 端口(默认 22) |
MCPGW_SSH_USER | SSH 用户 |
MCPGW_SSH_PWD | SSH 密码(建议用 env,不写进 config.json) |
MCPGW_SSH_AUTH | 认证方式:password(默认)或 key |
MCPGW_SSH_KEY | 私钥路径(auth=key 时使用) |
MCPGW_SSH_PASSPHRASE | 私钥口令(可选) |
运行时配置(~/.dsh/dsh-docker/config.json,位于用户主目录、勿提交 git)
{
"pollIntervalMs": 8000,
"activeTargetId": "remote",
"targets": [
{
"id": "local",
"name": "本机 Docker",
"type": "local",
"dockerPath": ""
},
{
"id": "remote",
"name": "远端服务器",
"type": "ssh",
"ssh": {
"host": "203.0.113.10",
"port": 22,
"user": "root",
"auth": "password",
"password": ""
}
}
]
}
旧版单
ssh配置会自动迁移为targets数组中的 SSH 目标。
推荐配置方式
- 插件「连接设置」弹窗(推荐):侧边栏「Docker」→ 右上「设置」→ 填写 SSH host / port / user,选择认证方式(密码或密钥),保存。密码经 DPAPI 加密落盘,界面不回显。
- 环境变量:适合脚本/CI,不落盘。
- 手工写 config.json:如上示例。
运行时配置(~/.dsh/dsh-docker/config.json,位于用户主目录、勿提交 git)
{
"pollIntervalMs": 8000,
"activeTargetId": "remote",
"targets": [
{
"id": "local",
"name": "本机 Docker",
"type": "local",
"dockerPath": ""
},
{
"id": "remote",
"name": "远端服务器",
"type": "ssh",
"ssh": {
"host": "203.0.113.10",
"port": 22,
"user": "root",
"auth": "password",
"password": ""
}
}
]
}
旧版单
ssh配置会自动迁移为targets数组中的 SSH 目标。
推荐配置方式
- 插件「连接设置」弹窗(推荐):侧边栏「Docker」→ 右上「设置」→ 填写 SSH host / port / user,选择认证方式(密码或密钥),保存。密码经 DPAPI 加密落盘,界面不回显。
- 环境变量:适合脚本/CI,不落盘。
- 手工写 config.json:如上示例。
🖥️ 使用
面板布局
- 顶部:管理目标选择器(本机 / SSH 远端)+ 连接状态指示 + 设置按钮
- MCP tab:已部署(deployed)/ 仓库(catalog)两个子页
- 已部署:查看 profile 中的 MCP servers,部署/移除
- 仓库:搜索官方 Docker MCP Catalog,一键部署
- 容器 tab:容器(ps)/ 镜像(images)两个子页
- 容器:列表、启停/重启/删除、日志、详情、进入终端、清理停止容器、新建容器
- 镜像:拉取、构建、导入、运行、单个删除、批量勾选删除
交互式容器终端(仅 SSH 目标)
- 在容器列表点击「终端」
- 面板内打开
docker exec -it sh交互式 shell(PTY) - 支持实时输入输出、窗口尺寸调整、关闭会话
自定义部署 MCP
- 远端 https 地址:直接填 MCP server URL
- 本地镜像:先在本机
docker pull成功,再填镜像地址;gateway 以--pull never加载本地镜像 - 写入目标 profile 的 working_set 后需重启 gateway 生效(面板一键重启,自动带
--verify-signatures=false解决镜像签名校验访问 Docker Hub CDN 被墙的问题)