feat(wslc): add WSL Containers (wslc://) transport, lifecycle integra… - #2659
Open
DavidTavoularis wants to merge 1 commit into
Open
feat(wslc): add WSL Containers (wslc://) transport, lifecycle integra…#2659DavidTavoularis wants to merge 1 commit into
DavidTavoularis wants to merge 1 commit into
Conversation
…tion and auto-detection
WSL Containers (wslc) runs dockerd inside a lightweight VM that exposes no
Windows named pipe or TCP port; the only host-visible channel is the stdio
bridge `wslc system session run docker system dial-stdio`. This adds first-class
wslc support to docker-java.
Transport (docker-java-transport, -transport-httpclient5):
- WslcSocket: a Socket whose streams are the wslc dial-stdio child process
(mirrors NamedPipeSocket; java.util.logging only, no new dependency).
- ApacheDockerHttpClientImpl: a `wslc` scheme case plus a WslcSocket branch.
Hijacked exec/attach/log streams work unchanged at the HttpClient5 socket level.
Lifecycle integration (docker-java-core):
- wslc's Windows integration (127.0.0.1 port relay and Windows-path bind mounts)
is wired by the wslc control plane only when a container is created/started
through the native `wslc` CLI, not over the Docker API on the same dockerd.
- WslcLifecycleDockerHttpClient decorates a Docker-API client and reconciles just
the affected calls with the wslc CLI, delegating everything else unchanged:
POST /containers/create -> wslc create, POST /containers/{id}/start -> wslc
start (wires relay+bind), POST /networks/create -> wslc network create, and
GET /containers/{id}/json with NetworkSettings.Ports overridden from `wslc list`
(the start relay's real host port differs from the daemon's recorded one).
- Activated transparently in DockerClientImpl.getInstance only when the host
scheme is wslc, so unix/npipe/tcp are unaffected and no extra dependency is
needed. Consumers that shade docker-java-core (e.g. Testcontainers) pick it up
after a plain rebuild.
Auto-detection (DefaultDockerClientConfig):
- when DOCKER_HOST is unset, fall back to wslc://localhost on Windows only if the
//./pipe/docker_engine pipe is absent and wslc is available (`wslc version`
exit 0, WSLC_EXECUTABLE-overridable), so Docker Desktop/Podman keep winning.
Tests run without a daemon or wslc CLI: WslcSocketTest (executable resolution and
connect failure) and WslcLifecycleDockerHttpClientTest (request pass-through,
inspect fallback when wslc is unavailable, create-failure handling).
Refs: docker-java#2658
Signed-off-by: David Tavoularis <[email protected]>
Co-authored-by: Claude <[email protected]>
DavidTavoularis
marked this pull request as ready for review
July 21, 2026 13:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tion and auto-detection
WSL Containers (wslc) runs dockerd inside a lightweight VM that exposes no Windows named pipe or TCP port; the only host-visible channel is the stdio bridge
wslc system session run docker system dial-stdio. This adds first-class wslc support to docker-java.Transport (docker-java-transport, -transport-httpclient5):
wslcscheme case plus a WslcSocket branch. Hijacked exec/attach/log streams work unchanged at the HttpClient5 socket level.Lifecycle integration (docker-java-core):
wslcCLI, not over the Docker API on the same dockerd.wslc list(the start relay's real host port differs from the daemon's recorded one).Auto-detection (DefaultDockerClientConfig):
wslc versionexit 0, WSLC_EXECUTABLE-overridable), so Docker Desktop/Podman keep winning.Tests run without a daemon or wslc CLI: WslcSocketTest (executable resolution and connect failure) and WslcLifecycleDockerHttpClientTest (request pass-through, inspect fallback when wslc is unavailable, create-failure handling).
Refs: #2658