1
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 5 years have passed since last update.

docker-composeで使用するyamlファイルを指定する

Posted at

環境ごとの差異を吸収したい

docker-compose コマンドはデフォルトではdocker-compose.yamlファイルが使用されるようになっているが、ローカル環境とCI環境でコンテナを分けたいときなどは、使用したいyamlファイルも異なってくる。
そういったケースのために、使用するyamlファイルを指定するオプションもきちんと用意されている。

コマンドの使用方法

コンテナ起動

$ docker-compose -f [指定したいファイル名] up

ex

$ docker-compose -f docker-compose-ci.yaml up

コンテナビルド

$ docker-compose -f [指定したいファイル名] build

ex

$ docker-compose -f docker-compose-ci.yaml build
1
0
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
1
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?