`stream` config option changes `docker.cli.exec()` behavior
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- docker, typescript
调研方向
Start at the docker.cli.exec() implementation and reproduce the two calls shown in the issue, comparing argument escaping with and without the stream option. Done means streaming stdio preserves the escaping used by the non-streaming call and returns the expected file contents without the Docker mount-argument error.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
In the docker.cli.exec() function, the third argument allows specifying options. Using a truthy object option for { stream: {} } changes how the args are escaped. This means I'm unable to escape paths for bind mounts when streaming stdio.
Steps to reproduce the behavior:
- Run a demo extension
- In frontend, use
const client = createDockerDesktopClient();
- Verify the following works:
client.docker.cli.exec('run', ['--mount', `type=bind,source="some-path-with-quotes",target=/file`, 'alpine:latest', 'sh', '-c', `"cat file"`]).then(console.log).catch(console.error)
- Try the same command with
streamset
client.docker.cli.exec('run', ['--mount', `type=bind,source="some-path-with-quotes",target=/file`, 'alpine:latest', 'sh', '-c', `"cat file"`], {
stream: {
onError(e) {
console.error(e)
}
}
})
Describe the expected behavior
Normally, the function will run and return file contents via output.stdout as you would expect. However, when you specify anything for stream, we see
invalid argument "type=bind,source=\"/Users/$USER/my-file.json\",target=/config.json" for "--mount" flag: parse error on line 1, column 18: bare " in non-quoted-field
See 'docker run --help'.
Optional: Add screenshots
If applicable, add screenshots to help explain your problem.
**Output of docker extension version:
Client Version: v0.2.27
Server API Version: 0.3.4
Output of docker version:
Client:
Version: 27.5.1
API version: 1.47
Go version: go1.22.11
Git commit: 9f9e405
Built: Wed Jan 22 13:37:19 2025
OS/Arch: darwin/arm64
Context: desktop-linux
Server: Docker Desktop 4.38.0 (181016)
Engine:
Version: 27.5.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.11
Git commit: 4c9b3b0
Built: Wed Jan 22 13:41:25 2025
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.7.25
GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e946
docker-init:
Version: 0.19.0
GitCommit: de40ad0
- 主要语言
- 没有语言数据
- 星标
- 157
- 派生
- 56
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/extensions-sdk 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 45/100
docker/extensions-sdk#305 ·
-
bug
难度 2/5 1-3 小时 新手友好度 45/100
docker/extensions-sdk#304 ·
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
docker/extensions-sdk#301 ·
-
bug
难度 3/5 1-2 天 新手友好度 25/100
docker/extensions-sdk#300 · 1 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 42/100
docker/extensions-sdk#299 · 1 条评论 ·
查看 docker/extensions-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
run_all sleeps after the final job despite documenting delays between jobs可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commit可能已有人在做 @myOmikron 今天认领。 未关闭bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 82/100
-
BUG
难度 2/5 1-3 小时 新手友好度 70/100
Mai-with-u/MaiBot#2187 ·
维护者通常 1 天内回复
-
AG-UI bug pkg:core
难度 2/5 1-3 小时 新手友好度 72/100
pydantic/pydantic-ai#10538 ·
维护者通常 1 天内回复