Skip to content

Conversation

@thomhurst
Copy link

Summary

Improves Unix socket connection handling to work better with Docker socket proxy wrappers (like those used in some CI environments such as custom GitHub runners with DinD).

Changes

  • For .NET 8+: Use SocketsHttpHandler with ConnectCallback instead of the legacy ManagedHandler
  • For all platforms: Add KeepAlive socket option for better proxy compatibility
  • New configuration: Add UnixSocketConnectTimeout property (default 30 seconds)
  • Improved error handling: Proper socket disposal on connection failure

Files Changed

File Change
DockerClientConfiguration.cs Added UnixSocketConnectTimeout parameter/property
DockerClient.cs SocketsHttpHandler for .NET 8+, improved ManagedHandler for .NET Standard
DockerClientConfigurationTests.cs Unit tests for configuration defaults

Test plan

  • Unit tests pass
  • CI integration tests on Ubuntu

🤖 Generated with Claude Code

@thomhurst thomhurst force-pushed the feat/improve-unix-socket-handling branch from 771ee02 to 09cd6c3 Compare December 30, 2025 11:05
- Use SocketsHttpHandler with ConnectCallback for .NET 8+ (more robust)
- Add KeepAlive socket option for better proxy socket compatibility
- Add configurable UnixSocketConnectTimeout (default 30s)
- Improve error handling with proper socket disposal
- Add unit tests for DockerClientConfiguration

This change addresses issues with Docker socket proxy wrappers (like those
used in some CI environments) that may not work with the legacy ManagedHandler.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@thomhurst thomhurst force-pushed the feat/improve-unix-socket-handling branch from 09cd6c3 to f329d87 Compare December 30, 2025 11:12
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.

1 participant