docker/compose Docker Image
Docker Compose是Docker官方提供的工具,可帮助用户通过YAML文件便捷地定义、配置和运行由多个Docker容器组成的应用程序,实现服务、网络和卷等组件的统一管理与一键部署,详情参见官方文档[]
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.
- Define your app's environment with a
Dockerfileso it can be reproduced anywhere. - Define the services that make up your app in
docker-compose.ymlso they can be run together in an isolated environment. - Lastly, run
docker-compose upand 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.
docker 命名空间的其他可用镜像:
docker/dockerfile
docker/ucp-auth
docker/desktop-stats
docker/desktop-kubernetes
docker/welcome-to-docker
docker/buildkit-syft-scanner
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务