[Bug]: Windows Docker Desktop + WSL2 环境下沙箱挂载 .gitconfig 失败

Open
#587 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, go

Research direction

Start by reproducing the Docker sandbox startup on Windows x86_64 with Docker Desktop and WSL2 using the YAML and runtime-v0.8.0 described in the issue. Trace the Docker driver’s persistent .gitconfig bind-mount handling and compare the resulting source and target types with the provided error log. Done means the sandbox starts and the persisted file is mounted at /root/.gitconfig on this environment.

Written by the indexing model from the issue text.

Description

bug priority:pending triage:needs-info
Summary

在 Windows x86_64、Docker Desktop + WSL2 环境中,Agent Compose 服务和 UI 可以正常启动,项目 YAML 也能成功启用,但运行智能体时 Docker 沙箱启动失败。

失败发生在将持久化的 .gitconfig 文件挂载到 Guest 容器的 /root/.gitconfig 时。同一份 YAML 在 macOS Docker Desktop 环境下可以正常运行。

Steps to reproduce
  1. 在 Windows x86_64 上安装 Docker Desktop,并使用 WSL2 后端。
  2. 启动 agent-compose runtime-v0.8.0。
  3. 创建并启用以下项目:
name: simple-chat-agent

agents:
  simple-assistant:
    provider: codex
    system_prompt: |
      你是一个简洁、可靠的中文助手。
    image: chaitin/agent-compose-guest:latest
    driver:
      docker: {}
    scheduler:
      enabled: false
    capset_ids: []
    enabled: true
在 UI 中运行 simple-assistant。
Docker 沙箱创建成功,但启动时挂载 /root/.gitconfig 失败。
 4. Expected behavior
Docker 沙箱应当正常启动,并将持久化目录中的 .gitconfig 作为普通文件挂载到 Guest 容器的 /root/.gitconfig。

### Expected behavior

在 Windows Docker Desktop + WSL2 环境下,Docker 沙箱应当正常启动,并将持久化目录中的 .gitconfig 作为普通文件挂载到 Guest 容器的 /root/.gitconfig,智能体能够正常运行。

### Actual behavior

沙箱在启动智能体进程之前失败。Docker Desktop 通过 WSL2 转换挂载路径后,无法将 .gitconfig 挂载到 /root/.gitconfig,并提示源路径与目标路径的文件/目录类型不一致。

### Version or commit

_No response_

### Runtime driver

None

### Logs

```text
sandbox start failed: start docker container <container-id>:
Error response from daemon: failed to create task for container:
failed to create shim task:
OCI runtime create failed:
runc create failed:
unable to start container process:
error during container init:
error mounting "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/<mount-id>"
to rootfs at "/root/.gitconfig":
mount src=<redacted>,
dst=/root/.gitconfig,
flags=MS_BIND|MS_REC:
not a directory:
Are you trying to mount a directory onto a file (or vice-versa)?
Check if the specified host path exists and is the expected type.
Dominant language
Go
Stars
241
Forks
45
Avg merge
19h 10m
Merged PRs (30d)
46

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from chaitin/agent-compose

All issues in chaitin/agent-compose

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.