Compose V2
Compose V2 と新たなdocker compose
コマンド
重要
Docker CLI の一部として
compose
コマンドをサポートした、新たな Compose V2 が利用できるようになりました。Compose V2 は Docker プラットフォーム内に compose 機能を統合するものです。 これまでの
docker-compose
機能やフラグのほとんどを受け継いでいます。 Compose V2 の確認は、単にダッシュ (-
) を空白に変えるだけであって、docker-compose
ではなくdocker compose
を実行することで行うことができます。
Starting with Docker Desktop 3.4.0, you can run Compose V2 commands without modifying your invocations, by enabling the drop-in replacement of the previous docker-compose
with the new command. See the section Installing Compose for detailed instructions.
Context of Docker Compose evolution
Introduction of the Compose specification makes a clean distinction between the Compose YAML file model and the docker-compose
implementation. Making this change has enabled a number of enhancements, including adding the compose
command directly into the Docker CLI, being able to “up” a Compose application on cloud platforms by simply switching the Docker context, and launching of Amazon ECS and Microsoft ACI. As the Compose specification evolves, new features land faster in the Docker CLI.
Compose V2 implementation relies directly on the compose-go bindings which are maintained as part of the specification. This allows us to include community proposals, experimental implementations by the Docker CLI and/or Engine, and deliver features faster to users. Compose V2 also supports some of the newer additions to the Compose specification, such as profiles and GPU devices.
Additionally, Compose V2 also supports Apple silicon.
For more information about the flags that are supported in the new compose command, see the docker-compose compatibility list.