Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker error : the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty' [duplicate]

After I run this
$ docker run --rm -v "/c/users/vipul rao/documents/github/wappalyzer:/opt/wappalyzer" -it wappalyzer/dev

I am getting the following error

the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'

What should I use here? I am running Docker on Windows 8 in MINGW64.

like image 395
Vipul Rao Avatar asked Feb 05 '18 12:02

Vipul Rao


People also ask

What is TTY Docker?

A pseudo terminal (also known as a tty or a pts ) connects a user's “terminal” with the stdin and stdout stream, commonly (but not necessarily) through a shell such as bash . … In the case of docker, you'll often use -t and -i together when you run processes in interactive mode, such as when starting a bash shell.

Is git bash a TTY?

If you are using mintty, try prefixing the command with 'winpty' Bookmark this question.

Is error may also indicate that the Docker daemon is not running?

In the default daemon configuration on Windows, the docker client must be run elevated to connect . This error may also indicate that the docker daemon is not running. 3) If you reopen cmd or powershell, you should repeat the related steps again.

How do I run a command in a Docker container?

Running Commands in an Alternate Directory in a Docker Container. To run a command in a certain directory of your container, use the --workdir flag to specify the directory: docker exec --workdir /tmp container-name pwd.

How to fix Docker error - the input device is not TTY?

docker error : the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty' [duplicate] Closed 1 year ago. the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty' What should I use here? I am running Docker on Windows 8 in MINGW64.

What does “the input device is not a TTY” mean?

In this post I will try to help you fix error like “The input device is not a TTY”. This error will occur if you are trying to run docker container using -it option, which means that you want to run docker container for interactive processes (like a shell).

How do I run a docker command without a TTY?

If you don't need either, e.g. running your command inside of a Jenkins or cron script, you should do this. Or you can change it to -i if you have input piped into the docker command that doesn't come from a TTY. If you have something like xyz | docker ... or docker ... <input in your command line, do this.

Is it redundant to have a TTY in a docker container?

It's not redundant, docker can create a TTY without attaching anything to it. Your output would have characters for color, etc, but your terminal output would not be piped into the input of the container. So the characters you type would be queued up for the next command you run after the docker command exits.


2 Answers

As suggested by the error message you obtain, you should try to use winpty (which is installed by default with Git-Bash) and thus run:

winpty docker run --rm -v "/c/users/vipul rao/documents/github/wappalyzer:/opt/wappalyzer" -it wappalyzer/dev 

If this works, you may want to set a Bash alias to avoid manually prepending winpty all the time:

echo "alias docker='winpty docker'" >> ~/.bashrc 

or

echo "alias docker='winpty docker'" >> ~/.bash_profile 
like image 71
ErikMD Avatar answered Sep 22 '22 05:09

ErikMD


If you are using Git Bash you can try like this

winpty docker run -it ubuntu 
like image 30
w3outlook Avatar answered Sep 20 '22 05:09

w3outlook