Open fungos opened 8 years ago
I agree, on my install Docker Quickstart was opening in cmd.exe. I am already using mintty for other things and I want Docker Quickstart to use it too. The git-for-windows installer has an option to use cmd.exe or mintty, maybe the Docker Toolbox installer can have a similar option?
I'm doing this on Win10 and Console2:
@echo off docker-machine.exe start default docker-machine.exe env --shell=cmd default >%temp%\docker_env.bat %temp%\docker_env.bat
docker run ...
Thanks for the issue!
I made the change recommended above, going from...
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"
... to...
"C:\Program Files\Git\usr\bin\mintty.exe" -i "c:\Program Files\Docker Toolbox\docker-quickstart-terminal.ico" /usr/bin/bash --login -i "c:\Program Files\Docker Toolbox\start.sh"
... as the target of my Docker Quickstart Terminal shortcut. However, something about that seems to cause stdin to not be considered a tty. (I might not be using these terms correctly... please forgive me and feel free to correct my usage as necessary.)
For example, when I run docker run --rm -it api bash
(where api
is one of the items in my docker-compose.yml
file), the result is cannot enable tty mode on non tty input
. However, if I try the same command using the orignal (Git-Bash based) Docker QuickStart Terminal, it actually tries to run the command.
It's quite possible that something about my environment is non-standard, and that most users won't have this problem. It just seemed worth mentioned so that someone else could at least verify whether this seems to be a common issue.
I have the same issue. Also, note that there are problems with arrow keys in both terminals.
try to put a winpty before the command: winpty docker run --rm -it api bash
I have no idea why this happens, but seem pretty common on windows, check: https://github.com/docker/toolbox/issues/136
ya - I also get
$ docker run --rm -it debian bash
cannot enable tty mode on non tty input
without adding winpty
now.
and sadly, if you use winpty in the other terminals, that also breaks.
same issue +1, expect to see mintty to work well
For better docker terminal use ConEmu
ConEmu is opensource console emulator with tabs, which represents multiple consoles and simple GUI applications as one customizable GUI window.
Download it from: http://www.fosshub.com/ConEmu.html
Install it. Open the terminal from the windows home button. It will ask 'to which program this terminal should bind?'. Select 'docker quick start terminal', click save.
Start the ConEmut terminal. Enjoy the docker terminal with ConEmu. :)
Why docker
command present does not work outside of Quickstart Terminal? (tries to connect to localhost, but not VM)
I don't think this comment belongs in this issue, instead have a look at the command:
eval $(docker-machine env default)
docker login does not work in mintty:
bash-4.3$ docker login
Error: Cannot perform an interactive login from a non TTY device
winpty works though.
This problem still occurs, I tried
"%DOCKER_TOOLBOX_INSTALL_PATH%\..\Git\usr\bin\bash.exe"-l -i "%DOCKER_TOOLBOX_INSTALL_PATH%\start.sh" -new_console:t:"Docker"
cmd
"C:\Program Files\Git\usr\bin\mintty.exe"
(image below)
environment Windows 10 x64
work fine in git bash. (windows : git)
NOTES : for those who cannot login in windows you can use manual command promt like "cmd" (windows : cmd) if get error you can try this one https://github.com/docker/docker/issues/22338
winpty docker run -it ubuntu bash
I use git-sdk from here: https://github.com/git-for-windows/build-extra/releases and I am able to run with winpty. The below command works fine
alias dr="winpty docker run dr -it -p 80:80 nginx
Instead of using aliases you can put: exec winpty bash on the end of you .profile - first bash is replaced by new bash behind winpty so every program that you run inside git-bash will find proper tty - which means python will work also, and docker run/login/attach
Since i'm using same git shell for everything (docker, ansible, chef, vagrant, terraform, ...) it's important that it works fine (and looks fine - no scrollbar, shift up/down/pageup/down, alt enter to full screen, ... :-).
And you don't even have to press ctrl-d twice when you want to exit, just once cause first shell is replaced with second.
I tried to put winpty in windows shortcut but it didn't work, here is command "C:\Program Files\Git\usr\bin\winpty.exe" "C:\Program Files\Git\git-bash.exe" --cd-to-home It opens two windows, and second one doesn't get proper tty (first one is dead).
On git bash just type: alias docker="winpty docker" and tty will work
Another Approach, do a docker login
from powershell and then use git-bash
I made the change recommended above, going from...
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"
... to..."C:\Program Files\Git\usr\bin\mintty.exe" -i "c:\Program Files\Docker Toolbox\docker-quickstart-terminal.ico" /usr/bin/bash --login -i "c:\Program Files\Docker Toolbox\start.sh"
... as the target of my Docker Quickstart Terminal shortcut. However, something about that seems to cause stdin to not be considered a tty. (I might not be using these terms correctly... please forgive me and feel free to correct my usage as necessary.)For example, when I run
docker run --rm -it api bash
(whereapi
is one of the items in mydocker-compose.yml
file), the result iscannot enable tty mode on non tty input
. However, if I try the same command using the orignal (Git-Bash based) Docker QuickStart Terminal, it actually tries to run the command.It's quite possible that something about my environment is non-standard, and that most users won't have this problem. It just seemed worth mentioned so that someone else could at least verify whether this seems to be a common issue.
Sorry for commenting on such an old post... I wanted to to the same thing as suggested in the thread title. This thread post got me the desired results (host machine is Windows 10 Home).
The current terminal uses git-bash.exe to launch the console and run the script start.sh. This console fallbacks to the basic cmd.exe where there are plenty of limitations (like window resizing, copy-paste, scrolling, etc.).
A better alternative would skip the git-bash.exe wrapper shipped with Git for windows and going directly to the alternative console that git for windows uses internally.
This console is called mintty.exe and it is an implementation based on putty to replace cmd.exe. This console fixes all these annoying problems and enables more customization.
The fix is very simple, only need to run this way (the installer should take care of the hard-coded paths obviously):