2
2

More than 1 year has passed since last update.

【Docker】the input device is not a TTY解消法

Posted at

状況

以下のようにdocker compose execを実行したところthe input device is not a TTYとなりました。

ターミナル
 $ docker compose exec <サービス名> <コマンド>
the input device is not a TTY

解消法

docker compose exec-Tを付けることで解消しました。

ターミナル
$ docker compose exec -T <サービス名> <コマンド>

-Tオプションについて確認するためにdocker compose exec --helpを実行しました。

ターミナル
$ docker compose exec --help

Usage:  docker compose exec [options] [-e KEY=VAL...] [--] SERVICE COMMAND [ARGS...]

Execute a command in a running container.

Options:
  -d, --detach                       Detached mode: Run command in the background.
  -e, --env stringArray              Set environment variables
      --index int                    index of the container if there are multiple instances of a service [default: 1].
                                     (default 1)
  -T, --no-TTY docker compose exec   Disable pseudo-TTY allocation. By default docker compose exec allocates a TTY.
      --privileged                   Give extended privileges to the process.
  -u, --user string                  Run the command as this user.
  -w, --workdir string               Path to workdir directory for this command.

-Tを付けることによって擬似TTYの割り当てを無効にすることができるようです。

2
2
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
2
2