LoginSignup
53
50

More than 3 years have passed since last update.

Git for Windowsでdocker execをwinptyなしで実行する

Last updated at Posted at 2018-07-23

Docker for Windows + Git for Windows環境で、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'

winptyをつければエラーとならずにコンテナに入ることができる。

$ winpty docker exec -it my-container bash
bash-4.2#

しかし、毎回winptyコマンドをつけるのが面倒。
そこで、/etc/profile.d/aliases.shを以下のように編集し、Git for Windowsを再起動すると、

-   for name in node ipython php php5 psql python2.7
+   for name in node ipython php php5 psql python2.7 docker

winptyなしでdocker execができるようになった。

$ docker exec -it my-container bash
bash-4.2# 

aliases.shのファイルは上書き禁止になっているので注意が必要。
一度デスクトップ等にコピーし、エディタで編集してから管理者権限でコピーし直すとかが楽かも。

53
50
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
53
50