-
Notifications
You must be signed in to change notification settings - Fork 104
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
Attach interactively to docker container #41
Comments
Note: an answer is available at the bottom of the issue.Not the slightest idea what your actual use case is and what you want. |
Well, maybe an example could help. Expected: Actual:
It can be executed only when omitting the -i flag but, this will no more keep the stdin open which reduces some usability. |
To start wsltty, you would have to somehow invoke wsltty, not just ubuntu bash. |
I've started wsltty the way its described in the readme so its not a case of misuse but can be misunderstanding, an issue or something else, however I'll close this myself and reopen it when again when I am able to get an isolated example may help us both determine the intent. Thanks. |
Imagine following Situation:
If I want to log into a docker container (which is a usual task during the use of docker. have a look here: https://askubuntu.com/a/507009) I'd type this command: But then, I'll get following error: After prefixing 'winpty' the 'command not found' message appears. Calling |
So I suggest to install https://github.com/rprichard/winpty. |
There's also https://github.com/tiangolo/babun-docker |
@mintty I tried both suggestions before, but no successful result. I didn't get a time to dig further |
I don't use cygwin. I just installed WSL and instead of using the old fashioned cmd for the ubuntu bash I also installed wsltty, which btw is awesome! I think more cannot be said. If you still have questions, please ask! :) |
Your codepage issue is probably an instance of mintty/mintty#376 and the I/O interworking one of mintty/mintty#56, both not really being mintty issues. So you invoke Windows docker from WSL (inside wsltty), right? |
FWIW: wslbridge and winpty aren't that related, though I wrote both. wslbridge is more robust.
WSL can run console programs, but in my limited testing, it didn't work very well. A WSL pty was regarded as a I looked into Docker/winpty integration a while ago. IIRC, Docker had a client program that didn't use Cygwin/MSYS, and it worked something like a Windows SSH client -- if its stdio were connected to a console, then it'd create a pty in the Linux VM and handle escape sequences, and otherwise, it would just copy bytes between the Linux VM and the Windows STDIN/STDOUT/STDERR file handles. If you tried to run Docker in mintty with a Cygwin pty, then it'd kinda work, except that it wouldn't create a Linux pty? wslbridge has a Cygwin/MSYS program frontend that connects to a WSL pty, but it wouldn't be that hard to flip it around. You could use inverted-wslbridge to connect from wsltty to a Cygwin pty, then run winpty inside that. That's 4 adapters to the Linux VM, though:
Maybe it'd be OK -- wslbridge mostly just adds latency. A WSL winpty adapter might be possible. It would be easier if WSL could access Win32 named pipes. (Maybe it can, somehow?) Maybe winpty could use sockets instead of named pipes. It could also make sense to have a WSL docker adapter (i.e. WSL pty -> Linux pty). I'm wondering what's happening in the Docker VM when |
I have the same exact issue. Installed Docker for Windows. Enabled WSL. Exposed the TCP port. Created windows Firewall rule. Can run docker.exe commands however I installed wsltty, ran it from the context menu, still getting the same message. Am I missing something? |
This issue is related to subtle mutual interaction between pty-based and console-based programs. See rprichard's comment above for some technical details. |
Does docker have an interactive mode? (A kind of shell?) |
It could make sense to package winpty with wsltty, I suppose. You'd need a special shortcut that launches mintty with cmd using winpty. Needing to start a new terminal window to connect to a Docker instance strikes me as disruptive to one's workflow, but maybe it's OK? It's unfortunate that the Docker instance and mintty both use VT100 I/O, but we have to bridge between the two with console I/O, a translation process that's lossy and adds latency. |
Not really belonging here, but: I noticed again, on this occasion, that with winpty cmd.exe ^C does not work (which is better than quitting cmd.exe, of course). Any chance to fix that? |
winpty's Ctrl-C problem is tracked here, rprichard/winpty#116. It's hard to fix. |
I got same issue when I try docker -it command in the bash on Ubuntu on Windows (WSL) , it report below errors: Hope it can be fixed soon |
What {quote}? |
Here is how to make it work:
|
I had this problem with the original WSL on Windows. I couldn't work out how to get rid of
P.S. I fooled myself at one point by inadvertently running |
Released 3.1.0.2, bundling binary installer with cygwin 3.1.0, with ConPTY support. |
As the title, Could not
attach
orexec
using--interactive
STDIN with errorthe input device is not a TTY
The text was updated successfully, but these errors were encountered: