一 命令说明
1 build
构建或重新构建服务。服务被构建后会以project_service的形式标记,例如:composetest_db。
2 help
查看指定命令的帮助文档,该命令非常实用。docker-compose所有命令的帮助文档都可通过该命令查看。例如:
[root@master ~]# docker-compose help build
Build or rebuild services.
Services are built once and then tagged as `project_service`,
e.g. `composetest_db`. If you change a service's `Dockerfile` or the
contents of its build directory, you can run `docker-compose build` to rebuild it.
Usage: build [options] [SERVICE...]
Options:
--force-rm Always remove intermediate containers.
--no-cache Do not use cache when building the image.
--pull Always attempt to pull a newer version of the image.
3 kill
通过发送SIGKILL信号停止指定服务的容器。例如: