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"