Skip to content

Upgrade Docker SDK to v27.5.1 to support Docker API 1.44+#119

Merged
ramonskie merged 2 commits intomainfrom
upgrade-docker-sdk-v27
Nov 25, 2025
Merged

Upgrade Docker SDK to v27.5.1 to support Docker API 1.44+#119
ramonskie merged 2 commits intomainfrom
upgrade-docker-sdk-v27

Conversation

@ramonskie
Copy link
Copy Markdown
Contributor

@ramonskie ramonskie commented Nov 25, 2025

Summary

  • Upgrades Docker SDK from v24.0.9 to v27.5.1 to fix compatibility with modern Docker daemons (Docker 25+) that require API version 1.44+
  • Migrates all deprecated type usages to new subpackages introduced in Docker SDK v27.x
  • Maintains backward compatibility with Docker 1.12+ through automatic API version negotiation

Problem

The previous Docker SDK v24.0.9 only supported API versions up to 1.43, causing runtime errors when connecting to Docker 25+ daemons:

client version 1.43 is too old. Minimum supported API version is 1.44

Solution

This upgrade brings support for Docker API versions 1.24 through 1.47+, with the SDK automatically negotiating the highest compatible version with the daemon.

Changes Made

Commit 1: Upgrade Docker SDK to v27.5.1

  • Updated github.com/docker/docker from v24.0.9 to v27.5.1
  • Migrated Docker SDK type references to new subpackages (breaking changes in v27.x):
    • types.ImagePullOptionsimage.PullOptions
    • types.ContainerRemoveOptionscontainer.RemoveOptions
    • types.ContainerStartOptionscontainer.StartOptions
    • types.ContainerLogsOptionscontainer.LogsOptions
    • types.CopyToContainerOptionscontainer.CopyToContainerOptions
  • Added required OpenTelemetry dependencies

Commit 2: Fix linting errors

  • Migrated additional deprecated types flagged by staticcheck linter:
    • types.NetworkListOptionsnetwork.ListOptions
    • types.NetworkCreatenetwork.CreateOptions
    • types.NetworkCreateResponsenetwork.CreateResponse
    • types.NetworkResourcenetwork.Inspect
    • types.ContainerPathStatcontainer.PathStat
  • Removed unused types package imports
  • Renamed loop variables to avoid shadowing imported network package
  • Updated 17 files total (implementation, tests, and mocks)

Verification

  • ✅ All tests pass
  • ✅ Code compiles without errors
  • ✅ Linter (golangci-lint) passes with no deprecation warnings
  • ✅ Verified with Docker daemon API 1.51 (Docker 28.5.2)

Compatibility

  • Supported Docker versions: 1.12 - 28.x
  • API version range: 1.24 - 1.47+
  • Backward compatible: Yes, via automatic API version negotiation

This upgrade fixes compatibility issues with modern Docker daemons
(Docker 25.x+) which require minimum API version 1.44. The previous
SDK v24.0.9 only supported up to API 1.43.

Changes:
- Updated github.com/docker/docker from v24.0.9 to v27.5.1
- Migrated Docker SDK type references to new subpackages:
  * types.ImagePullOptions → image.PullOptions
  * types.ContainerRemoveOptions → container.RemoveOptions
  * types.ContainerStartOptions → container.StartOptions
  * types.ContainerLogsOptions → container.LogsOptions
  * types.CopyToContainerOptions → container.CopyToContainerOptions
- Updated imports across implementation, test, and fake files
- Added required OpenTelemetry dependencies

The SDK now supports API versions 1.24-1.47+ with automatic version
negotiation, ensuring compatibility with Docker versions from 1.12
through 28.x.
Copy link
Copy Markdown
Contributor

@ivanovac ivanovac left a comment

Choose a reason for hiding this comment

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

LGTM

@ramonskie ramonskie merged commit 09ba863 into main Nov 25, 2025
2 checks passed
@ramonskie ramonskie deleted the upgrade-docker-sdk-v27 branch November 25, 2025 15:24
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