compose README

The project's README from github.com/docker/compose. As one markdown file: README.md.

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:

(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.

compose (docker/compose)

Searching Database…

38.4K ·GitHub
这是什么?Docker Compose 是一个用于定义和运行多容器 Docker 应用的工具,通过一个 Compose 文件(compose.yaml)进行配置。
它是独立工具,还是 Docker 的一部分?它是 Docker 的一个 CLI 插件,通过 'docker compose' 调用,并随 Docker Desktop 在 Windows 和 macOS 上一起提供。
我该如何让 Docker Compose 运行起来?在 Windows 和 macOS 上,它随 Docker Desktop 一起提供。在 Linux 上,从发布页面下载二进制文件,将其重命名为 docker-compose,并放到 cli-plugins 文件夹中,例如 $HOME/.docker/cli-plugins 或 /usr/local/lib/docker/cli-plugins。
除了 Docker 本身,我还需要别的东西吗?你需要先安装 Docker 引擎,因为 Compose 是运行在它之上的插件;在 Linux 上,你可能需要手动使用 chmod 为二进制文件添加可执行权限。
Docker Swarm 能获得同样的功能吗?不能。Docker Swarm 仍依赖旧版 Compose 文件格式,没有跟进较新的 Compose 规范增强,因此 Swarm 用户无法使用一些较新的 Compose 功能。
它可以在哪些平台上运行?Windows 和 macOS 通过 Docker Desktop 运行,Linux 则通过作为 CLI 插件安装的独立二进制文件运行。
基本的工作流程是什么样的?先为应用的运行环境编写 Dockerfile,再在 compose.yaml 中描述各个服务,然后运行 docker compose up 启动整个应用栈。
有没有更早的基于 Python 的版本?有。最初的 Python 实现(Compose v1)仍可在 v1 分支中找到,但本仓库的 Go 版本才是当前版本。
它和直接使用 docker run 有什么不同?无需手动逐个启动和连接容器,你可以在一个 YAML 文件中声明所有服务、网络和数据卷,然后用一条命令一起启动。
What are similar projects?k9s, kompose, rook, dokku, minikube, kops, ctop, tilt
Creator
docker
Size
29.3 MB
Stars
38.4K
Age
12y
Commits · 90 Days