LoginSignup
1
0

More than 3 years have passed since last update.

docker-compose.yml のマイナーバージョンを省略してはいけない

Posted at

version

docker-compose.yml のサンプルコードでマイナーバージョンが省略されているのをしばしば見かけます。
しかし省略して version: "3" と書いた場合 version: "3.0" 扱いになってしまいます。
最新のバージョンを使いたい場合はマイナーバージョンまで指定します。

docker-compose.yml
version: "3.8"

公式ドキュメント

Compose file versions and upgrading | Docker Documentation

Note: When specifying the Compose file version to use, make sure to specify both the major and minor numbers. If no minor version is given, 0 is used by default and not the latest minor version. As a result, features added in later versions will not be supported. For example:

docker-compose.yml
version: "3"

is equivalent to:

docker-compose.yml
version: "3.0"
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