Skip to content

Conversation

@robmry
Copy link

@robmry robmry commented Oct 23, 2025

What does this PR do?

Docker 29.0.0 replaces its old client/api code with new Go modules, making a lot of breaking changes:

Why is it important?

Related issues

@robmry robmry force-pushed the moby-go-modules branch 5 times, most recently from 631150b to 6df128d Compare October 24, 2025 13:32
@robmry robmry changed the title WIP - Update to moby 29.0.0 api/client chore!: WIP - Update to moby 29.0.0 api/client Oct 24, 2025
@robmry robmry changed the title chore!: WIP - Update to moby 29.0.0 api/client chore!: update to moby 29.0.0 api/client - WIP Oct 24, 2025
@robmry robmry force-pushed the moby-go-modules branch 4 times, most recently from 35c1508 to 2ddfe33 Compare October 30, 2025 10:45
// Inspect returns the container's raw info
func (c *Container) Inspect(ctx context.Context) (*container.InspectResponse, error) {
inspect, err := c.dockerClient.ContainerInspect(ctx, c.ID())
func (c *Container) Inspect(ctx context.Context, options client.ContainerInspectOptions) (client.ContainerInspectResult, error) {
Copy link
Member

@mdelapenya mdelapenya Oct 31, 2025

Choose a reason for hiding this comment

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

suggestion: the SDK uses functional options to customise the different operations (see network.Inspect). I'd like to have here inspect options instead, so the user can compose what they want without the need of passing an empty struct for defaults.

Copy link
Author

@robmry robmry Nov 11, 2025

Choose a reason for hiding this comment

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

Thanks @mdelapenya - as discussed on Slack ... I had a go at this, but ended up with a circular import

container/wait/wait.go has this interface - which would need the new WithInspectOptions (potentially defined here in container/inspect.go). But, package container already imports package container/wait ...

type StrategyTarget interface {
	Host(context.Context) (string, error)
	Inspect(context.Context, ...container.InspectOptions) (dockerclient.ContainerInspectResult, error)
    ...

Docker 29.0.0 shipped, so the rest of this change should be stable now - please feel free to update this PR with a fix, or let me know what shape it should have.

@robmry robmry force-pushed the moby-go-modules branch 3 times, most recently from e4176eb to efb8183 Compare November 7, 2025 11:39
@robmry robmry force-pushed the moby-go-modules branch 2 times, most recently from 90f0b7d to c63bfb3 Compare November 11, 2025 17:45
@robmry robmry marked this pull request as ready for review November 11, 2025 17:54
Copilot AI review requested due to automatic review settings November 11, 2025 17:54
@robmry robmry changed the title chore!: update to moby 29.0.0 api/client - WIP chore!: update to moby 29.0.0 api/client Nov 11, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the codebase to use Moby's new Docker 29.0.0 API/client modules. The changes involve migrating from the legacy github.com/docker/docker client/API packages to the new modular github.com/moby/moby/api and github.com/moby/moby/client structure introduced in Docker 29.0.0, addressing numerous breaking changes in the API surface.

Key changes:

  • Replaced github.com/docker/docker/api/types/* imports with github.com/moby/moby/api/types/*
  • Replaced github.com/docker/docker/client with github.com/moby/moby/client
  • Updated API method signatures to use new request/response types (e.g., ContainerCreateOptions, ImagePullResponse)
  • Migrated network port handling from nat.Port to network.Port
  • Updated Go version to 1.24.0 across modules

Reviewed Changes

Copilot reviewed 113 out of 121 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
volume/* Updated volume operations to use new moby client types and filter API
network/* Migrated network types and operations, including port/IPAM config handling
image/* Updated image build/pull/remove operations with new client types and response structures
container/* Comprehensive updates to container operations, port mappings, and network handling
client/* Core client wrapper updates to interface with new moby client API
config/* Updated auth config types to use moby registry types
legacyadapters/* Updated adapter layer for backward compatibility
*/go.mod Updated dependencies and Go version across all modules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +145 to +146
// TODO(robmry) - handle/log?
continue
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

TODO comment indicates error handling is incomplete. Consider at minimum logging parsing errors to aid debugging when port specifications are malformed.

Copilot uses AI. Check for mistakes.
@robmry robmry force-pushed the moby-go-modules branch 2 times, most recently from e6c2b33 to 9d26b05 Compare November 12, 2025 16:29
New Go modules with lots of breaking changes:
- moby/moby/api 1.52.0
- moby/moby/client 0.1.0

Signed-off-by: Rob Murray <[email protected]>
@robmry robmry marked this pull request as draft November 12, 2025 22:24
@robmry
Copy link
Author

robmry commented Nov 12, 2025

Moved back to draft - there's a delay getting DD updated, so breaking changes here will prevent Go-SDK updates in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants