| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…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 <david.tavoularis@mycom-osi.com>
Co-authored-by: Claude <noreply@anthropic.com>
|
@eddumelendez could you please review the PR ? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
…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):
Lifecycle integration (docker-java-core):
Auto-detection (DefaultDockerClientConfig):
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