Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container output while using docker run and exec is not captured to stdout #3838

Closed
attilaersek opened this issue Jan 25, 2023 · 7 comments
Closed
Assignees
Labels
kind/bug Something isn't working platform/windows runtime/moby triage/duplicate This issue or pull request already exists
Milestone

Comments

@attilaersek
Copy link

Actual Behavior

The output of a container is not captured and sent to stdout, eg.:

docker run --rm hello-world

displays nothing.

If the --interactive flag is provided (which normally used to capture stdin) then the output is displayed correctly:

docker run --rm -i hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

This breaks the functionality of some applications that rely on docker exec output, like kind. see: 3065

Steps to Reproduce

run command:

docker run --rm hello-world

Result

empty result.

Expected Behavior

container output is displayed on stdout.

Additional Information

No response

Rancher Desktop Version

1.70.

Rancher Desktop K8s Version

1.25.5

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11 22621.1105 using WSL2 Ubuntu 22.04.1

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

n/a

@gaktive
Copy link
Contributor

gaktive commented Jan 26, 2023

Hi @attilaersek

Thanks for filing this bug. Do you get any responsiveness upon hitting a key when the docker command without the -i is run? Or does it still stay idle and showing nothing?

This sounds somewhat similar to what was reported earlier in #1361 but your case reads like the opposite, especially since the earlier behaviour was fixed.

I'll keep investigating this and try to reproduce this behaviour. Otherwise, to confirm, are you running this in Powershell, the Windows terminal or another command line option?

@gaktive gaktive self-assigned this Jan 26, 2023
@gaktive gaktive added the triage/need-to-repro Needs to be reproduced by dev team label Jan 26, 2023
@attilaersek
Copy link
Author

Hi @attilaersek

Thanks for filing this bug. Do you get any responsiveness upon hitting a key when the docker command without the -i is run? Or does it still stay idle and showing nothing?

This sounds somewhat similar to what was reported earlier in #1361 but your case reads like the opposite, especially since the earlier behaviour was fixed.

It's responsive and otherwise works correctly:

$ time (docker run --rm hello-world)

real    0m1.249s
user    0m0.045s
sys     0m0.022s
$ time (docker run --rm -i hello-world)

Hello from Docker!
This message shows that your installation appears to be working correctly.

... 

real    0m1.057s
user    0m0.012s
sys     0m0.046s

The container run correctly and the logs can be read:

$ docker run --name hello-world hello-world
$ docker logs hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

The -i flag correctly assigns the stdin when it's needed.

I'll keep investigating this and try to reproduce this behaviour. Otherwise, to confirm, are you running this in Powershell, the Windows terminal or another command line option?

I'm using Windows Terminal 1.15.3466.0 with WSL2 Ubuntu 22.04.1:

$ wsl.exe --version

WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1105

$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
 ~  ⎈ rancher-desktop  $ 
$ uname -a
Linux GT-DT-192703 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

WSL2 integration is enabled and configured in rancher desktop:

$ which docker
/mnt/c/Users/AttilaÉrsek/AppData/Local/Programs/Rancher Desktop/resources/resources/linux/bin/docker
$ docker --version
Docker version 20.10.21-rd, build ac29474

Interesting, but when i try the same command from other shells in Windows Terminal it works, so the problem seems to be limited to the Ubuntu 22.04.01 WSL2 bash shell.

from rancher-dekstop shell:

~ # docker run --rm hello-world

Hello from Docker!

from powershell:

PS C:\Program Files\Microsoft Visual Studio\2022\Community> docker run --rm hello-world

Hello from Docker!

from cmd:

Microsoft Windows [Version 10.0.22621.1105]
(c) Microsoft Corporation. All rights reserved.

C:\Users\AttilaÉrsek>docker run --rm hello-world

Hello from Docker!

@attilaersek
Copy link
Author

attilaersek commented Jan 26, 2023

I've installed docker cli using homebrew and got the same behavior so this seems to be an Ubuntu/WSL issue and not rancher-desktop.
EDIT:
I was curious, so i've removed rancher desktop and installed docker into my WSL2 ubuntu directly, and with that setup it works as expected:

$ which docker
/usr/bin/docker
$ docker --version
Docker version 20.10.23, build 7155243
$ docker run --rm hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

@gaktive gaktive removed the triage/need-to-repro Needs to be reproduced by dev team label Jan 27, 2023
@gaktive
Copy link
Contributor

gaktive commented Jan 27, 2023

Thanks for your updates @attilaersek and I'm glad you've narrowed down what's going on.

Shall I go ahead and close this, or do you have any other questions?

@attilaersek
Copy link
Author

Well I just sorted out that the problem is not related to the docker cli client version. With docker-ce or docker desktop service the output works, but not with rancher-desktop.

@jandubois
Copy link
Member

Shall I go ahead and close this, or do you have any other questions?

No, this is a bug in Rancher Desktop that needs to be fixed. It only affects the Linux client (on WSL), but not the Win32 one:

jan@DESKTOP-4992680:~$ docker.exe run busybox uname -m
x86_64
jan@DESKTOP-4992680:~$ docker run busybox uname -m
jan@DESKTOP-4992680:~$ docker run -i busybox uname -m
x86_64

And it works properly on the macOS version:

$ docker run busybox uname -m
x86_64

@jandubois jandubois added this to the Later milestone Feb 1, 2023
@jandubois
Copy link
Member

I'm going to close this as a duplicate of #3239 though.

@jandubois jandubois added the triage/duplicate This issue or pull request already exists label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working platform/windows runtime/moby triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants