Skip to content

Add Docker API version negotiation to fix daemon compatibility#110

Merged
alexec merged 2 commits intomainfrom
copilot/fix-dynamodb-image-pull-error
Feb 10, 2026
Merged

Add Docker API version negotiation to fix daemon compatibility#110
alexec merged 2 commits intomainfrom
copilot/fix-dynamodb-image-pull-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Docker client was hardcoded to API v1.43, causing failures with daemons requiring v1.44+:

failed to pull image: Error response from daemon: client version 1.43 is too old. 
Minimum supported API version is 1.44

Changes

Added client.WithAPIVersionNegotiation() to all Docker client instantiations:

  • internal/proc/container.go - Run() and stop() methods
  • hack/examples.go - updateExample() function
// Before
cli, err := client.NewClientWithOpts(client.FromEnv)

// After
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())

Client now auto-negotiates API version on first request, maintaining compatibility with both older and newer Docker daemons.

Original prompt

[dynamodb] (failed) failed to pull image: Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix DynamoDB image pull error due to client version Add Docker API version negotiation to fix daemon compatibility Feb 7, 2026
Copilot AI requested a review from alexec February 7, 2026 17:20
@alexec alexec marked this pull request as ready for review February 9, 2026 10:34
Copilot AI review requested due to automatic review settings February 9, 2026 10:34
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

Adds Docker client API version negotiation when instantiating Docker clients, aiming to improve compatibility across Docker daemon versions.

Changes:

  • Enable API version negotiation in internal/proc/container.go Docker client creation (Run and stop paths)
  • Enable API version negotiation in hack/examples.go Docker client creation (example updater)

Reviewed changes

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

File Description
internal/proc/container.go Adds client.WithAPIVersionNegotiation() when creating Docker clients used for container lifecycle operations.
hack/examples.go Adds client.WithAPIVersionNegotiation() when creating Docker client used to pull/inspect images for docs/examples generation.
Comments suppressed due to low confidence (3)

internal/proc/container.go:53

  • WithAPIVersionNegotiation() only negotiates downward (it can downgrade to an older daemon API), and will not increase the client API version above what this build supports. Since the repo is currently pinned to github.com/docker/docker v24.0.9 (API v1.43), this change alone will still send v1.43 and will continue to fail against daemons whose minimum supported API is v1.44+. To fix the reported error, bump the Docker client dependency to a version that supports API v1.44+ (and keep negotiation for backward compatibility), or explicitly set a higher API version (with the tradeoff of dropping older-daemon support).
	cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
	if err != nil {
		return fmt.Errorf("failed to create docker client: %w", err)
	}
	defer cli.Close()

internal/proc/container.go:260

  • Same as above: API version negotiation won’t help if the compiled Docker client max/default API is still v1.43. With github.com/docker/docker v24.x, this will still fail against daemons requiring v1.44+. Consider updating the dependency to v25+ (and keep negotiation) so ContainerStop can succeed on newer daemons.
	cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
	if err != nil {
		return fmt.Errorf("failed to create docker client: %w", err)
	}
	defer cli.Close()

hack/examples.go:91

  • WithAPIVersionNegotiation() only allows the client to downgrade to match older daemons; it won’t upgrade a v24.x Docker client (API v1.43) to talk to daemons requiring v1.44+. If this hack script needs to run against newer Docker Engine versions, the underlying github.com/docker/docker dependency needs to be bumped to a release that supports API v1.44+ (negotiation can remain enabled for backward compatibility).
	cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
	if err != nil {
		return fmt.Errorf("failed to create client: %w", err)
	}
	defer cli.Close()

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

@alexec alexec merged commit a933ac4 into main Feb 10, 2026
8 checks passed
@alexec alexec deleted the copilot/fix-dynamodb-image-pull-error branch February 10, 2026 17:06
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.

3 participants