Docker 17参考手册
撰写 | Compose
docker-compose up
Usage: up [options] [--scale SERVICE=NUM...] [SERVICE...]
Options:
-d Detached mode: Run containers in the background,
print new container names.
Incompatible with --abort-on-container-exit.
--no-color Produce monochrome output.
--no-deps Don't start linked services.
--force-recreate Recreate containers even if their configuration
and image haven't changed.
Incompatible with --no-recreate.
--no-recreate If containers already exist, don't recreate them.
Incompatible with --force-recreate.
--no-build Don't build an image, even if it's missing.
--build Build images before starting containers.
--abort-on-container-exit Stops all containers if any container was stopped.
Incompatible with -d.
-t, --timeout TIMEOUT Use this timeout in seconds for container shutdown
when attached or when containers are already
running. (default: 10)
--remove-orphans Remove containers for services not defined in
the Compose file
--exit-code-from SERVICE Return the exit code of the selected service container.
Implies --abort-on-container-exit.
--scale SERVICE=NUM Scale SERVICE to NUM instances. Overrides the `scale`
setting in the Compose file if present.
构建,(重新)创建,启动并附加到服务的容器。
除非它们已经在运行,否则该命令还会启动任何链接的服务。
该docker-compose up
命令汇总每个容器的输出。当命令退出时,所有容器都停止。运行docker-compose up -d
将在后台启动容器并使其运行。
如果存在服务的现有容器,并且在创建容器后服务的配置或映像已更改,则docker-compose up
通过停止并重新创建容器(保留已安装的卷)来提取更改。要防止撰写选取更改,请使用该--no-recreate
标志。
如果您想强制 Compose 停止并重新创建所有容器,请使用该--force-recreate
标志。
如果进程遇到错误,则此命令的退出代码为1
。
如果使用SIGINT
(ctrl
+ C
)中断进程或者SIGTERM
容器停止,并且退出代码为0
。
如果SIGINT
或SIGTERM
在此关闭阶段再次发送,正在运行的容器将被终止,并且退出代码为2
。
fig, composition, compose, docker, orchestration, cli, up
撰写 | Compose相关

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。
主页 | https://docker.com/ |
源码 | https://github.com/docker/docker |
版本 | 17 |
发布版本 | 17.06 |