Don't use alias docker="winpty docker"
. It solves your problem but break pipes.
$ 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
Copy this to your .bashrc. This script uses winpty docker
only if -ti
is used.
function docker(){
for param; do if [[ "$param" == "-ti" ]] || [[ "$param" == "-it" ]]; then
winpty docker "$@"; return
fi; done;
command docker "$@"
}
docker run -ti ubuntu
becomes winpty docker run -ti ubuntu
avoids 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
becomes command docker run echo "what'up" | cat
avoids error: stdout is not a tty
The script only looks if there is a '-it' parameter without checking if it is inside a 'docker run' sentence... but it does the trick for my uses.