docker-compose.yml エラー「found a tab character that violates indentation」が発生した場合の対処法

docker-compose.yml エラー「found a tab character that violates indentation」が発生した場合の対処法

docker-compose.ymlを作成して「docker-compose up」実行時に、「found a tab character that violates indentation」が発生した場合の対処法を記述してます。

環境

  • OS CentOS Stream release 9
  • docker 20.10.21

エラー全文

以下のコマンドを実行時に発生

$ docker-compose up -d
yaml: line 11: found a tab character that violates indentation

原因

「docker-compose.yml」に「tab」キーを使用してタブを挿入しているため

対処法

「tab」キーを使用せずに「sapce」キーでスペースを記述する