docker kill $(docker ps -q)
停止所有 容器
docker ps(list containers)
[root@ip-172-30-69-214 test]# docker ps --help
Usage: docker ps [OPTIONS]
List containers
Options:
-a, --all Show all containers (default shows just running) # 不论状态,默认只是运行中的
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print containers using a Go template
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display container IDs # 只显示 container id
-s, --size Display total file sizes
docker kill(kill container(s))
[root@ip-172-30-69-214 test]# docker kill --help
Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
Kill one or more running containers
Options:
-s, --signal string Signal to send to the container (default "KILL")