rancher-desktop icon indicating copy to clipboard operation
rancher-desktop copied to clipboard

[WSL] docker run does not show execution output

Open evertonlperes opened this issue 3 years ago • 8 comments

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

  1. Open RD App and select dockerd container runtime
  2. Open a WSL distro console
  3. 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.

evertonlperes avatar Feb 09 '22 15:02 evertonlperes

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.

havran avatar Jun 09 '22 12:06 havran

We cannot use command line utilities with Rancher+WSL in order to we rely on their output. Any plan to fix it? Thanks.

segor avatar Nov 09 '22 09:11 segor

I realize docker run -i --rm hello-world works. Then -i parameter do the trick.

havran avatar Nov 09 '22 11:11 havran

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

evertonlperes avatar Nov 09 '22 14:11 evertonlperes

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).

antoineco avatar May 05 '23 08:05 antoineco

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

MBertling avatar Nov 10 '23 13:11 MBertling

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

CalaxDev avatar Feb 12 '24 10:02 CalaxDev

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

jandubois avatar Feb 12 '24 17:02 jandubois

I will close this issue and keep https://github.com/rancher-sandbox/rancher-desktop/issues/3239 as a reference for this issue.

Nino-K avatar Jun 03 '24 16:06 Nino-K