docker compose の仕様変更による進化

docker-compose から docker compose へ移行しようかと思い調べ始めたので記録

Context of Docker Compose evolution

  • Composeの仕様変更により compose yaml ファイルと docker-compose の実装が明確に切り離された
  • この変更により多くの機能追加ができるようになった
    • composeコマンドのdocker cliへの追加
    • Docker コンテキストの切り替えにより、クラウドプラットフォームへ アプリケーションを up する
      • Amazon ECS
      • Microsoft ACI
  • Compose v2 は仕様の一部としてメンテナンスされる compose-go バインディングに直接依存
  • これにより、コミュニティによる提案や、Docker cli/Engine による実験的な実装や機能のユーザへの提供を早めます
  • Compose v2 は Go で書かれている為、docker コマンドライン機能の統合を改善し、Python依存なしに各種デバイス上でネイティブに走ることが可能となります。

詳細は以下から

Overview of Docker Compose | Docker Documentation

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 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 specification, such as profiles and GPU devices.

Compose V2 has been re-written in Go, which improves integration with other Docker command-line features, and allows it to run natively on macOS on Apple silicon, Windows, and Linux, without dependencies such as Python.

For more information about compatibility with the compose v1 command-line, see the docker-compose compatibility list.

以下DeepL翻訳結果

Docker Composeの進化の背景 Compose仕様の導入により、ComposeのYAMLファイルモデルとdocker-composeの実装が明確に区別されるようになりました。この変更により、Docker CLIに直接composeコマンドを追加したり、Dockerコンテキストを切り替えるだけでクラウドプラットフォーム上のComposeアプリケーションを「アップ」したり、Amazon ECSやMicrosoft ACIの起動など、多くの機能拡張が可能になりました。Composeの仕様の進化に伴い、新機能はDocker CLIにいち早く搭載されます。

Compose V2は、仕様の一部として維持されているcompose-goバインディングに直接依存しています。これにより、コミュニティの提案や、Docker CLIやEngineによる実験的な実装を取り込み、より早くユーザーに機能を提供することができます。また、Compose V2はプロファイルやGPUデバイスなど、仕様に新しく追加されたものもサポートしています。

Compose V2はGoで書き直され、他のDockerコマンドライン機能との統合が改善され、Pythonなどの依存関係なしに、Apple silicon上のmacOS、Windows、Linuxでネイティブに動作するようになりました。

compose v1コマンドラインとの互換性については、docker-compose互換性リストを参照してください。