Skip to content

feat(docker): add dual-runtime Docker workbench - #4875

Open
Ezreal-byte wants to merge 25 commits into
t8y2:mainfrom
Ezreal-byte:codex/feature-docker-workbench
Open

feat(docker): add dual-runtime Docker workbench#4875
Ezreal-byte wants to merge 25 commits into
t8y2:mainfrom
Ezreal-byte:codex/feature-docker-workbench

Conversation

@Ezreal-byte

Copy link
Copy Markdown

Summary

  • 增加兼容 Tauri 与 Web 的 Docker Engine 连接、传输与工作台
  • 支持容器生命周期、Compose 常用子集、日志/监控/Inspect/只读文件预览
  • 支持镜像 Pull/Push/Delete/Export 及传输中心,支持卷与网络创建
  • 接入 DBX 主题、连接配色、七种语言、只读/生产确认与 Web 密码保护
  • 移除离线镜像导入和容器文件上传/下载能力

Review fixes

  • Web 流接口显式校验 HTTP 状态,避免 403/错误响应被误判为成功
  • 正确重组跨网络 chunk 的 Docker JSON 进度与错误
  • Registry 密码发起请求后立即从表单状态清理
  • 移除隐藏的大文件整块读取 API

Verification

  • cargo check --workspace --tests
  • pnpm typecheck
  • pnpm test(658 files / 5691 tests)

Closes #4874

@Ezreal-byte
Ezreal-byte force-pushed the codex/feature-docker-workbench branch from f509f80 to cabe20c Compare July 30, 2026 04:31
@Ezreal-byte

Copy link
Copy Markdown
Author

已同步最新 main 并更新 PR 分支,原有的 SidebarTreeRuntimeHost.vue / query.rs 合并冲突已消除。

I18n 兼容问题也已修复:Docker 文案改为 Autofill 可解析的对象字面量,当前 I18n Autofill 已通过

本地验证:

  • cargo check --workspace --tests
  • pnpm typecheck
  • pnpm test ✅(658 files / 5691 tests)

当前主 CI 显示 action_required,需要上游维护者批准 fork PR 的 Actions 工作流后才能运行。

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I found three blocking issues on b9f073f0474aea1563818028cdf1641f2ac76810.

  1. crates/dbx-core/src/docker/compose.rs:28 removes all existing project containers before every service has been parsed and validated. A later invalid service or Docker create/start failure therefore destroys the previous deployment and leaves a partial replacement. Please build and validate the complete execution plan before deletion, and add recovery or rollback behavior for failures during replacement.

  2. apps/desktop/src/lib/backend/http.ts:3513 still buffers the complete image archive when no writable file handle is available, and src-tauri/src/commands/docker_cmd.rs:263 still exposes the whole-image Vec<u8> command. Large images can exhaust backend or renderer memory. Please remove the full-buffer APIs and make every supported export path genuinely streaming, or reject runtimes where streaming persistence is unavailable.

  3. apps/desktop/src/components/docker/DockerWorkbench.vue:727 parses Docker JSON stream errors but then checks only the original SSE event.error. In Web mode, an HTTP 200 stream containing pull access denied is overwritten by the final done event and shown as a successful pull. Please branch on the parsed progress result and add a regression test covering a split Docker error followed by stream completion.

@Ezreal-byte
Ezreal-byte requested a review from t8y2 July 30, 2026 08:04
@Ezreal-byte

Ezreal-byte commented Jul 30, 2026

Copy link
Copy Markdown
Author

已完成本轮阻塞问题修复并同步最新 upstream/main,当前 head 为 7f4997d91

修复内容:

  1. Compose 安全替换:先解析并校验全部 services、生成完整执行计划,再开始任何 Docker 资源变更;替换过程记录旧容器名称及运行/暂停状态,创建、启动、重命名或网络操作失败时清理新资源并恢复旧部署。补充了后续 service 非法、创建失败、启动失败、备份重命名失败及部分回滚失败测试。
  2. 镜像导出内存边界:移除整镜像 Vec<u8> command/client 路径和 Web arrayBuffer()/Blob 回退;Tauri 仅流式写入目标文件,取消/失败删除未完成文件;Web 不具备 File System Access 流式持久化能力时在发请求前拒绝,并在请求失败时 abort writable。
  3. Pull 流错误终态:以解析后的 Docker JSON stream 结果作为最终状态;error/errorDetail.message 一旦出现,后续 completion 不会覆盖成成功。已增加“拆分 error JSON 后收到 done”的回归测试。
  4. Pull 任务即时显示:确认后、网络请求前立即登记 running/0-progress 任务并展开传输列表;Web/Tauri 沿用前端预生成 sessionId;单工作台只允许一个 Pull,覆盖请求建立前/建立中/运行中的取消竞态。

本地验证:

  • cargo fmt --all -- --check
  • cargo check --workspace --tests
  • pnpm typecheck
  • pnpm test ✅(674 files / 5817 tests)
  • Compose 定向测试 ✅(9 tests)
  • Docker Pull/传输/导出定向测试 ✅(4 files / 6 tests)
  • cargo clippy -p dbx-core --locked --lib --no-default-features --features duckdb-sidecar,mq-admin,sqlite-sqlcipher -- -D warnings
  • git diff --check

I18n Autofill 已通过。

…r-workbench

# Conflicts:
#	crates/dbx-core/src/sql_dialect/ddl_profile.rs
@t8y2 t8y2 added area/multiple Touches more than three repository areas enhancement New feature or request ui-change Changes user-visible interface, text, or visual assets labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/multiple Touches more than three repository areas enhancement New feature or request ui-change Changes user-visible interface, text, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 支持 Docker 管理工作台

3 participants