
Docker Compose
CLI用 compose.yaml 定义多容器应用,一条 docker compose up 拉起服务、数据库、缓存等整套环境,适合 agent 搭建本地开发与测试依赖。Docker 官方维护,macOS 随 Docker Desktop 附带。
Table of Contents
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-pluginsOR/usr/local/libexec/docker/cli-plugins/usr/lib/docker/cli-pluginsOR/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:
- Define your app's environment with a
Dockerfileso it can be reproduced anywhere. - Define the services that make up your app in
compose.yamlso they can be run together in an isolated environment. - Lastly, run
docker compose upand 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.
相關資源

Podman
CLI无需守护进程、支持 rootless 的容器与 Pod 管理工具,命令行与 Docker 兼容,可构建、运行、推送 OCI 镜像;macOS 与 Windows 需通过 podman machine 虚拟机运行。
podman-container-tools/podman33.1k
Dagger
CLI可编程的软件交付引擎:用 Go、Python、TypeScript 等 8 种语言的 SDK 编写构建、测试与发布流程,全部在容器中运行,本地与 CI 行为一致,自带 OpenTelemetry 追踪。需要 Docker 等容器运行时。
dagger/dagger16.3k
Docker CLI
CLIDocker 官方命令行,构建镜像、运行和管理容器、查看日志并推送到镜像仓库,是 agent 搭建隔离运行环境的基础工具。需要本机或远程的 Docker 引擎(如 Docker Desktop)。
docker/cli6.1k
Docker Skills
SkillDocker 官方技能合集:项目容器化、Dockerfile 构建优化与加固、Compose 编排、Docker Sandboxes 与 Docker Agent 用法,并对删除等破坏性操作加确认护栏。
docker/skills569
act
CLI在本地用 Docker 运行 GitHub Actions 工作流,改完 .github/workflows 不必反复提交推送就能验证 CI,也能把工作流当作本地任务运行器。需要本机安装 Docker。
nektos/act72.3k
Trivy
CLI一站式安全扫描器:检查容器镜像、文件系统、Git 仓库与 Kubernetes 集群中的已知漏洞、IaC 错误配置、泄露密钥与软件许可证,并能生成 SBOM。Aqua Security 开源维护。
aquasecurity/trivy38.5k
