3
1

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.

`docker-compose build` -> エラー`Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?`

Posted at

TL;TR

  • docker-composeを再インストールする
  • または、環境変数$COMPOSE_FILEにdocker-compose.ymlを指定する。

エラー文

        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml

エラー文の内容

  • コンフィグファイルないよ

docker-composeを再インストールのはなぜか

stackoverflowにそういった解決法が多く乗っていたから。

しかし、私はmacだったからか、docker-composeはDockerアプリに内蔵されており、linuxと同じ感じでアンインストール、インストールしても解決しなかった。

環境変数$COMPOSE_FILEにdocker-compose.ymlを指定する。

私の場合、developブランチとdocker環境ブランチが異なっており、それでdocker-compose.ymlへパスが通っていない?スコープに入っていない?感じだったのが原因だと思われる。詳細がわかったら追記したい。

export COMPOSE_FILE=docker-compose.local.yml
echo $COMPOSE_FILE

参考

https://docs.docker.com/docker-for-mac/install/
https://suin.io/535

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?