rancher-desktop
rancher-desktop copied to clipboard
[WSL] docker run does not show execution output
Rancher Desktop Version
1.0.1
Rancher Desktop K8s Version
1.22.6
Which container runtime are you using?
moby (docker cli)
What operating system are you using?
Windows
Operating System / Build Version
Windows 10 PRO 20H2
What CPU architecture are you using?
x64
Linux only: what package format did you use to install Rancher Desktop?
N/A
Windows User Only
N/A
Actual Behavior
Running a simple docker run --rm hello-world
does not show any output inside of WSL distro.
Steps to Reproduce
- Open RD App and select
dockerd
container runtime - Open a WSL distro console
- Run
docker run --rm hello-world
Result
An empty output will shows up after the command execution.
docker run --rm hello-world
WSL Debian 10
test@WinPRO-RDTest:~$ docker run --rm hello-world
test@WinPRO-RDTest:~$
WSL openSUSE Leap
test@WinPRO-RDTest:~> docker run --rm hello-world
test@WinPRO-RDTest:~>
Another example:
docker run --rm tutum/dnsutils nslookup api.github.com
test@WinPRO-RDTest:~$ docker run --rm tutum/dnsutils nslookup api.github.com
test@WinPRO-RDTest:~$
Expected Behavior
The output should appears after the command execution:
hello-world expected output:
Hello from Docker!
This message shows that your installation appears to be working correctly.
(...)
Another example:
docker run --rm tutum/dnsutils nslookup api.github.com
Server: 172.18.128.1
Address: 172.18.128.1#53
Non-authoritative answer:
Name: api.github.com
Address: 140.82.112.6
Additional Information
It seems to be isolated on WSL/dockerd execution only. Running the same command from PS and CMD works fine though.
I wan't able to replicate this issue through containerd
, it's working as expected.
I can confirm same behavior for:
Rancher Desktop Version 1.4.1
Rancher Desktop K8s Version N/A (disabled)
Which container runtime are you using? moby (docker cli)
What operating system are you using? Windows
Operating System / Build Version Windows 10 PRO 21H2
What CPU architecture are you using? x64
When i run docker run --rm hello-world
from windows command, it's work normally.
We cannot use command line utilities with Rancher+WSL in order to we rely on their output. Any plan to fix it? Thanks.
I realize docker run -i --rm hello-world
works. Then -i
parameter do the trick.
I realize
docker run -i --rm hello-world
works. Then-i
parameter do the trick.
Yep, it will keep the STDIN open, see more info here: https://docs.docker.com/engine/reference/run/#foreground
Inside WSL, requests to Docker pass through a proxy called dockerproxy
that is specific to Rancher Desktop: src/go/wsl-helper/cmd/dockerproxy_serve_linux.go.
This proxy seems to be responsible for a few things, such as making mounts work transparently.
I haven't looked into this yet, but I suspect that something needs to be done in the request munger (rough guess).
when you are facing the problem that the input device is not a TTY, you can also solve it with docker run -a stdin -a stdout --rm hello-world
Is this something that is still being looked at?
I would expect that if the command runs under windows without any extra arguments, it would do so the same in WSL Integrations
Is this something that is still being looked at?
Status is more or less the same as https://github.com/rancher-sandbox/rancher-desktop/issues/3239#issuecomment-1939158657
I will close this issue and keep https://github.com/rancher-sandbox/rancher-desktop/issues/3239 as a reference for this issue.