File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # docker compose down
2+
3+ > 停止并移除由 ` docker compose up ` 创建的容器、网络、镜像和卷。
4+ > 更多信息:< https://docs.docker.com/reference/cli/docker/compose/down/ > 。
5+
6+ - 停止并移除所有容器和网络:
7+
8+ ` docker compose down `
9+
10+ - 停止并移除容器、网络以及服务使用的所有镜像:
11+
12+ ` docker compose down --rmi all `
13+
14+ - 停止并移除容器、网络以及没有自定义标签的镜像:
15+
16+ ` docker compose down --rmi local `
17+
18+ - 停止并移除容器、网络和所有卷:
19+
20+ ` docker compose down {{[-v|--volumes]}} `
21+
22+ - 停止并移除所有资源,包括孤立容器:
23+
24+ ` docker compose down --remove-orphans `
25+
26+ - 使用另一个 Compose 文件停止并移除容器:
27+
28+ ` docker compose {{[-f|--file]}} {{路径/到/配置文件}} down `
29+
30+ - 使用以秒为单位的自定义超时停止并移除容器:
31+
32+ ` docker compose down {{[-t|--timeout]}} {{秒数}} `
33+
34+ - 移除 Compose 文件中未定义的服务所对应的容器:
35+
36+ ` docker compose down --remove-orphans {{[-v|--volumes]}} `
Original file line number Diff line number Diff line change 1+ # docker compose stop
2+
3+ > 停止正在运行的容器,但不移除它们。
4+ > 更多信息:< https://docs.docker.com/reference/cli/docker/compose/stop > 。
5+
6+ - 停止所有正在运行的服务:
7+
8+ ` docker compose stop `
9+
10+ - 停止指定服务:
11+
12+ ` docker compose stop {{服务1 服务2 ...}} `
13+
14+ - 使用以秒为单位的自定义关闭超时停止服务:
15+
16+ ` docker compose stop {{[-t|--timeout]}} {{秒数}} `
17+
18+ - 停止指定 Compose 文件中定义的服务:
19+
20+ ` docker compose {{[-f|--file]}} {{路径/到/配置文件}} stop `
21+
22+ - 模拟运行(显示操作但不执行):
23+
24+ ` docker compose stop --dry-run `
25+
26+ - 使用自定义超时停止指定服务:
27+
28+ ` docker compose stop {{[-t|--timeout]}} {{秒数}} {{服务1 服务2 ...}} `
Original file line number Diff line number Diff line change 1+ # docker container stop
2+
3+ > 停止一个或多个正在运行的容器。
4+ > 更多信息:< https://docs.docker.com/reference/cli/docker/container/stop/ > 。
5+
6+ - 停止一个 Docker 容器:
7+
8+ ` docker {{[stop|container stop]}} {{容器}} `
9+
10+ - 停止容器,并向其发送指定信号:
11+
12+ ` docker {{[stop|container stop]}} {{[-s|--signal]}} {{信号}} {{容器}} `
13+
14+ - 停止容器,并在强制终止前等待指定秒数:
15+
16+ ` docker {{[stop|container stop]}} {{[-t|--timeout]}} {{秒数}} {{容器}} `
17+
18+ - 停止一个或多个容器:
19+
20+ ` docker {{[stop|container stop]}} {{容器1 容器2 ...}} `
21+
22+ - 显示帮助:
23+
24+ ` docker {{[stop|container stop]}} --help `
You can’t perform that action at this time.
0 commit comments