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.
Fixes #3239
I added some logging to the proxy and observed the /attach API call converting to a websocket. This websocket is streaming data to/from the container.
I suspected the issue stemming from nonstandard docker behaviour when it comes to websockets, as one of the pipes gets closed when the container does not have stdin open.
The docker client knows the container spec and when stdin on the container is closed, outbound pipe from the client is EOF whilst the inbound pipe (stdout/err from container) is streaming data.
The issue can be worked around if you set DOCKER_HOST to
/mnt/wsl/rancher-desktop/run/docker.sock
effectively isolating the issue to the wsl-helper proxy.The PR is proof of concept - starts a proxy on the TCP level, and conditionally sends connections to the original proxy capable of munging the request data etc.
To verify fix, run
used https://github.com/jpillora/go-tcp-proxy
and https://github.com/docker/go-connections/blob/master/sockets/inmem_socket.go