Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

環境

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/

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした