Docker Compose是Docker官方提供的工具,可帮助用户通过YAML文件便捷地定义、配置和运行由多个Docker容器组成的应用程序,实现服务、网络和卷等组件的统一管理与一键部署,详情参见官方文档[]

210 次收藏下载次数: 0状态:社区镜像维护者:Docker 官方工具与组件镜像仓库类型:镜像最近更新:5 年前
下载命令
点击查看

Important
📣 Docker Compose is now included as part of the https://hub.docker.com/_/docker 🎉

This image contains Compose v1, which has reached end of life (EOL) and is no longer supported. This image’s tags are frozen and are not updated.

If you want to use Compose directly from a container you can use the https://hub.docker.com/_/docker:

>docker run --rm -it docker compose version`   
Docker Compose version v2.20.2`  

If you want to embed Compose inside your own image, you can use the https://hub.docker.com/repository/docker/docker/compose-bin/general to copy the Compose binary into your image:

# syntax=docker/dockerfile:1
FROM my-image
COPY --from=docker/compose-bin:v2.20.2 /docker-compose /usr/bin/compose
RUN compose version

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application's services. Then, using a single command, you create and start all the services from your configuration. To learn more about all the features of Compose see https://github.com/docker/docker.github.io/blob/master/compose/overview.md#features.

Compose is great for development, testing, and staging environments, as well as CI workflows. You can learn more about each case in https://github.com/docker/docker.github.io/blob/master/compose/overview.md#common-use-cases.

Using Compose is basically 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 docker-compose.yml 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 docker-compose.yml looks like this:

version: '2'

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

For more information about the Compose file, see the https://github.com/docker/docker.github.io/blob/master/compose/compose-file/compose-versioning.md

Compose has commands for managing the whole lifecycle of your application:

  • Start, stop and rebuild services
  • View the status of running services
  • Stream the log output of running services
  • Run a one-off command on a service

Installation and documentation

  • Full documentation is available on https://docs.docker.com/compose/.
  • If you have any questions, you can talk in real-time with other developers in the #docker-compose IRC channel on Freenode. Click here to join using IRCCloud.
  • Code repository for Compose is on https://github.com/docker/compose
  • If you find any problems please fill out an https://github.com/docker/compose/issues/new

Contributing

Want to help build Compose? Check out our https://github.com/docker/compose/blob/master/CONTRIBUTING.md.

Releasing

Releases are built by maintainers, following an outline of the https://github.com/docker/compose/blob/master/project/RELEASE-PROCESS.md.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 compose 镜像标签

docker pull docker.xuanyuan.run/docker/compose:<标签>

DockerHub 原生拉取命令

docker pull docker/compose:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持99.95% SLA 保障付费会员免广告