3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GitHub Actions内でdocker-compose execコマンド実行したときに"the input device is not a TTY"エラーが出たときの解決法

Last updated at Posted at 2021-03-21

はじめに

githubactionでdocker-compose exec コマンドを普通に利用すると

the input device is not a TTY

のようなエラーが発生してしまう。

今回はその解決方法を示す。

解決方法

docker-composeコマンドに-T オプションをつける!

例)

$ docker-compose exec -T [docker-compose service] [コマンド]

githubaction内で記述すると、こんな感じです!

githubactionファイル
name: githubaction sample

 # 省略

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Git checkout current branch #作業ブランチにchekout
      uses: actions/checkout@v2 
      with:
        ref: ${{ github.ref }}
    - name: docker compose exec command sample
      run:  docker-compose up -d &&
            docker-compose exec -T [docker-compose service] [コマンド]

以上です!
みなさんの問題解決につながればと思います。

3
0
1

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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?