Add Docker CLI support to Docker image with INSTALL_EXT build argument (#366)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
This commit is contained in:
Copilot
2025-10-12 16:51:02 +08:00
committed by GitHub
parent 435227cbd4
commit d4bdb099d0
4 changed files with 162 additions and 0 deletions

View File

@@ -41,6 +41,38 @@ docker run -d \
mcphub:local
```
### 构建扩展功能版本
Docker 镜像支持 `INSTALL_EXT` 构建参数以包含额外工具:
```bash
# 构建扩展功能版本(包含 Docker CLI、Chrome/Playwright
docker build --build-arg INSTALL_EXT=true -t mcphub:extended .
# 运行容器并挂载 Docker socket用于 Docker-in-Docker 工作流)
docker run -d \
--name mcphub \
-p 3000:3000 \
-v $(pwd)/mcp_settings.json:/app/mcp_settings.json \
-v /var/run/docker.sock:/var/run/docker.sock \
mcphub:extended
# 验证 Docker CLI 可用
docker exec mcphub docker --version
```
<Note>
**INSTALL_EXT=true 包含的功能:**
- **Docker CLI**:用于容器管理和基于 Docker 的工作流
- **Chrome/Playwright**(仅 amd64用于浏览器自动化任务
扩展镜像较大,但为高级用例提供了额外功能。
</Note>
<Warning>
挂载 Docker socket`/var/run/docker.sock`)时,容器将获得访问主机 Docker 守护进程的权限。仅在可信环境中使用此功能。
</Warning>
## Docker Compose 设置
### 基本配置