Help us understand the problem. What is going on with this article?

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

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"
SnowCait
C# と PHP と あいうら が好きな気分屋さん。 フリーランスとして主にソーシャルゲームの開発をしています。 最近は GitHub Actions に興味があります。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした