chore: evaluate Docker Go SDK for context-aware container runtime support

未关闭
#539 9 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@SafeeImran 已经在做这个了。

开始于 2026年9月26日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, go
领域
cli, devtools, tooling

调研方向

The evaluation focuses on the container client in pkg/connectors. Start by reviewing the current github.com/docker/docker/client usage there. Create a proof-of-concept using docker/go-sdk to test the required capabilities, especially context resolution for Docker Desktop. Run existing container-client tests to ensure compatibility. The outcome is a recommendation, not a full migration.

由索引模型根据 Issue 内容生成。

描述

component/connectors help wanted keep-open kind/task

Description

Evaluate the official docker/go-sdk as a replacement for the current low-level github.com/docker/docker/client integration.

The current client reads DOCKER_HOST but does not resolve Docker CLI contexts. Consequently, microcks-cli may try /var/run/docker.sock even when Docker Desktop uses the active desktop-linux context and exposes its socket at $HOME/.docker/run/docker.sock.

The Docker Go SDK provides Docker-context discovery, but it has not reached v1.0.0. We should verify that it supports all capabilities required by microcks-cli before adopting it.

Goals

  • Test whether docker/go-sdk/client correctly resolves the active Docker context.
  • Verify that it supports all current container operations.
  • Determine whether it can preserve Docker and Podman compatibility.
  • Estimate the migration from github.com/docker/docker to the newer Docker/Moby API packages.
  • Produce a go/no-go recommendation.

Required capabilities

Verify support for:

  • Pulling container images and streaming pull progress.
  • Creating containers with port bindings and auto-remove.
  • Starting and stopping containers.
  • Inspecting whether a container exists.
  • Closing the client cleanly.
  • Docker API-version negotiation.
  • Explicit DOCKER_HOST configuration.
  • Active Docker context resolution.
  • DOCKER_CONTEXT overrides.
  • Docker Desktop’s $HOME/.docker/run/docker.sock.
  • Linux’s /var/run/docker.sock.
  • Windows named pipes.
  • Remote contexts and their TLS configuration.
  • Podman through its Docker-compatible socket.

Compatibility scenarios

At minimum, test:

  1. Docker Desktop on macOS with the /var/run/docker.sock compatibility symlink disabled.
  2. Docker Desktop on macOS with the compatibility symlink enabled.
  3. Explicit DOCKER_HOST.
  4. Local Docker Engine on Linux.
  5. Podman machine on macOS or Windows.
  6. Rootless Podman on Linux.
  7. A named Docker context.
  8. An unreachable or invalid context, ensuring the error is actionable.

Dependency assessment

Document:

  • The exact docker/go-sdk version tested.
  • Its API stability and release status.
  • Required changes to existing Docker API type imports.
  • Interaction with testcontainers-go and microcks.io/testcontainers-go.
  • Any dependency-version conflicts.
  • Binary-size impact, if material.
  • Whether adopting it requires a complete Moby API migration or can be isolated to pkg/connectors.

Because the SDK is pre-v1, any adoption should pin an exact released version rather than a branch or pseudo-version.

Acceptance criteria

  • A small proof of concept exercises the operations currently used by containerClient.

  • The proof of concept successfully connects through the desktop-linux context without setting DOCKER_HOST.

  • DOCKER_HOST and DOCKER_CONTEXT precedence is verified.

  • Docker and Podman behavior is documented.

  • Existing container-client tests continue to pass or required changes are identified.

  • The issue concludes with one of:

    • Adopt: create a focused migration issue with the required changes.
    • Defer: document the missing capabilities or stability concerns and retain the current client.
    • Reject: document the incompatibilities and the preferred alternative.

Non-goals

  • Rewriting the complete container abstraction during the evaluation.
  • Migrating production code before compatibility is demonstrated.
  • Replacing the separate Testcontainers integration unless the evaluation identifies a concrete requirement.
主要语言
Go
星标
59
派生
74
平均合并
4 天 5 小时
30 天内合并 PR
15

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microcks/microcks-cli 的其他 Issue

查看 microcks/microcks-cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。