Vip*_*Rao 28 git github tty docker
我跑完之后
$ docker run --rm -v "/c/users/vipul rao/documents/github/wappalyzer:/opt/wappalyzer" -it wappalyzer/dev
我收到以下错误the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'
我应该在这里使用我在MINGW64的Windows 8上运行.
Eri*_*kMD 39
根据您获得的错误消息的建议,您应该尝试使用winpty(默认情况下使用Git-Bash安装),然后运行:
winpty docker run --rm -v "/c/users/vipul rao/documents/github/wappalyzer:/opt/wappalyzer" -it wappalyzer/dev
Run Code Online (Sandbox Code Playgroud)
如果这样做,您可能需要设置Bash别名以避免一直手动前置winpty
:
echo "alias docker='winpty docker'" >> ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
要么
echo "alias docker='winpty docker'" >> ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)
Eme*_*bah 10
这对我有用。我在 Windows 上使用 git bash
winpty docker-compose exec app ls -l
Run Code Online (Sandbox Code Playgroud)
不要使用 alias docker="winpty docker"
. 它解决了您的问题,但会破坏管道。
$ winpty docker run -ti ubuntu
root@e85cff7d1670:/# exit
$ wintpy docker run ubuntu bash HELLO
HELLO
$ wintpy docker run ubuntu bash HELLO | cat
stdout is not a tty
Run Code Online (Sandbox Code Playgroud)
将其复制到您的 .bashrc。此脚本winpty docker
仅在-ti
使用时使用。
function docker(){
for param; do if [[ "$param" == "-ti" ]] || [[ "$param" == "-it" ]]; then
winpty docker "$@"; return
fi; done;
command docker "$@"
}
Run Code Online (Sandbox Code Playgroud)
docker run -ti ubuntu
变得winpty docker run -ti ubuntu
回避error: the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'"
docker run ubuntu echo "what's up" | cat
变得command docker run echo "what'up" | cat
回避error: stdout is not a tty
该脚本只查看是否有“-it”参数,而不会检查它是否在“docker run”语句中……但它对我的使用很有帮助。
你启动了“Docker Quickstart Terminal”吗?我试着跑
$ docker run -i -t redcricket/react-tutorial:latest /bin/bash
Run Code Online (Sandbox Code Playgroud)
在来自 Cygwin bash shell 的 Windows 上并得到相同的错误:
the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'
Run Code Online (Sandbox Code Playgroud)
然后我记得当我在 Windows 10 系统上安装 docker 时,安装了一个名为“Docker Quickstart Terminal”的东西。您需要先从任务栏上那个愚蠢的窗口“在此处键入以进行搜索”开始:
这启动了这个……
...您可以在那里运行您的 docker 命令而不会出现该错误或运行 winpty。
归档时间: |
|
查看次数: |
22683 次 |
最近记录: |