LoginSignup
9
6

More than 5 years have passed since last update.

Dockerコンテナにexecする際にthe input device is not a TTYが出た時

Last updated at Posted at 2018-12-08

環境

OS:Windows10(Docker for Windows)
ターミナルエミュレーター:Mintty(Git Bash)

内容

Dockerコンテナ内に入ろうと「docker exec・・・」コマンドを打ったら、以下のようなエラーが出ました。

docker exec -it my-container bash
the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'

標準入力がTTYじゃないです。Minttyを使っているならコマンドの先頭に「winpty」を付けて再実行してください、とのこと。「環境」にも記載しましたが、当方コマンドを入力する時はGit Bashを利用しており、それが原因でした(Git BashのデフォルトエミュレーターはMintty)。なので、エラーメッセージに記載のある通り

winpty docker exec -it my-container bash

でイケました。ちなみに、Windows標準コマンドプロンプトでは「winpty」を付けなくてもイケます。

以上です。

参考

https://opcdiary.net/?page_id=27065
https://willi.am/blog/2016/08/08/docker-for-windows-interactive-sessions-in-mintty-git-bash/

9
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
6