compose

dockerApache-2.0活跃维护

用 YAML 文件定义多容器应用,一条命令就能把整套服务编排起来跑,省去逐个 docker run 的麻烦。

Define and run multi-container applications with Docker

v5.7.0发布于 2026-11-02 15:01 UTC38,669star +38 / 7 天5,900fork同步于 2026-11-10 05:19 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求按 README 关键词推断
有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

这个条目还没有人工点评。如果它对你很有用,欢迎到 提交仓库 页写下你的使用经验。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    最近发版

    5 个版本v5.7.0
    1. v5.7.0最新正式版2026-11-02 · 2026-11-02 15:01 UTC

      What's Changed

      ℹ️ Heads-up for users of Compose as a library: Up now runs its Create and Start phases as a single plan over a single daemon snapshot, for up -d (#14290) and interactive up (#14305), as scale, watch rebuilds and start already do (#14291, #14296). The CLI behaves as before. If you call api.Compose.Up from your own program:

      • Up now validates its options first, with the same rules as the CLI flags: UpOptions.Validate() returns an *api.IncompatibleOptionsError (errors.Is(err, api.ErrIncompatibleOptions)) for Start.Wait combined with Start.Attach, and for a detached Up (no Start.Attach) combined with OnExit, ExitCodeFrom or Watch. Those combinations used to be silently ignored (#14306).
      • Up works on the project it is given and ignores StartOptions.Project.
      • The daemon is not observed again between the two phases: a container that exits after the plan is built is not started again, and one removed in between makes its start fail instead of being skipped. A planning error of the Start phase now fails before any container is created.
      • A foreground Up now gives a use_api_socket service its /run/secrets/docker/config.json, as up -d does, and shows the output of pre_start hooks.
      • The keyboard menu of an interactive up is no longer built by the library: set NavigationMenu: true and pass an implementation with compose.WithNavigationMenu(...), otherwise no menu is displayed and a warning says so (#14324).

      Other changes to the library surface in this release: DownOptions.Images is now an api.ImagePruneMode (untyped constants still compile, a string variable needs a conversion) and an invalid value is rejected before Down removes anything (#14149); compose.ServiceHash, compose.NetworkHash and compose.VolumeHash are no longer exported, the helpers having moved to an internal package (#14405); api.Compose is now assembled from six smaller interfaces, with the same method set (#14322); PushOptions.IgnoreMissing is added.

      ✨ Improvements

      Execution plan

      Commands

      Other

    2. v5.6.12026-10-21 · 2026-10-21 07:54 UTC
      查看更新说明

      update to go1.26.10 These releases include 1 security fix following the security policy:

      • crypto/x509: mitigation for security concerns with a specific Certificate Authority

        We're blocking trust in a small set of intermediate certificates due to specific security concerns around their operation.

        Verify will now filter out chains which contain these intermediates, preventing them from being returned to the caller.

        We highly recommend immediately upgrading to this release.

        This is CVE-2026-111943 and Go issue https://go.dev/issue/82345.

      Full Changelog: https://github.com/docker/compose/compare/v5.6.0...v5.6.1

    3. v5.6.02026-10-02 · 2026-10-02 16:07 UTC
      查看更新说明

      What's Changed

      ℹ️ This release adds partial support for jobs: only manually-triggered jobs are supported for now, scheduled jobs are not yet available. Full job support will land once the corresponding Docker Engine support is merged.

      ✨ Improvements

      Jobs

      Provider services

      Other

      🐛 Fixes

      🔧 Internal

    4. v5.5.12026-09-03 · 2026-09-03 15:53 UTC
      查看更新说明

      What's Changed

      ✨ Improvements

      🐛 Fixes

      🔧 Internal

    5. v5.5.02026-08-17 · 2026-08-17 10:01 UTC
      查看更新说明

      What's Changed

      ℹ️ This release overhauls image digest reconciliation to prevent unnecessary container recreation.
      Existing containers may be recreated the first time you run compose up after upgrading, as image digests are re-evaluated using the new logic.

      compose pull now honors pull_policy refresh windows (daily, weekly, every_N).

      ✨ Improvements

      🐛 Fixes

      🔧 Internal

      ⚙️ Dependencies

      New Contributors

    README 原文

    未翻译

    Table of Contents

    Docker Compose

    GitHub release PkgGoDev Build Status Codecov OpenSSF Scorecard Docker Compose

    Docker Compose is a tool for running multi-container applications on Docker defined using the Compose file format. A Compose file is used to define how one or more containers that make up your application are configured. Once you have a Compose file, you can create and start your application with a single command: docker compose up.

    Note: About Docker Swarm Docker Swarm used to rely on the legacy compose file format but did not adopt the compose specification so is missing some of the recent enhancements in the compose syntax. After acquisition by Mirantis swarm isn't maintained by Docker Inc, and as such some Docker Compose features aren't accessible to swarm users.

    Where to get Docker Compose

    Windows and macOS

    Docker Compose is included in Docker Desktop for Windows and macOS.

    Linux

    You can download Docker Compose binaries from the release page on this repository.

    Rename the relevant binary for your OS to docker-compose and copy it to $HOME/.docker/cli-plugins

    Or copy it into one of these folders to install it system-wide:

    • /usr/local/lib/docker/cli-plugins OR /usr/local/libexec/docker/cli-plugins
    • /usr/lib/docker/cli-plugins OR /usr/libexec/docker/cli-plugins

    (might require making the downloaded file executable with chmod +x)

    Quick Start

    Using Docker Compose is a three-step process:

    1. Define your app's environment with a Dockerfile so it can be reproduced anywhere.
    2. Define the services that make up your app in compose.yaml so they can be run together in an isolated environment.
    3. Lastly, run docker compose up and Compose will start and run your entire app.

    A Compose file looks like this:

    services:
      web:
        build: .
        ports:
          - "5000:5000"
        volumes:
          - .:/code
      redis:
        image: redis
    

    Contributing

    Want to help develop Docker Compose? Check out our contributing documentation.

    If you find an issue, please report it on the issue tracker.

    Legacy

    The Python version of Compose is available under the v1 branch.