docker_practice/container/rm.md
Kang Huaishuai 0a87d2a643
Update container markdown format
Signed-off-by: Kang Huaishuai <khs1994@khs1994.com>
2021-03-07 23:54:43 +08:00

19 lines
593 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 删除容器
可以使用 `docker container rm` 来删除一个处于终止状态的容器例如
```bash
$ docker container rm trusting_newton
trusting_newton
```
如果要删除一个运行中的容器可以添加 `-f` 参数Docker 会发送 `SIGKILL` 信号给容器
# 清理所有处于终止状态的容器
`docker container ls -a` 命令可以查看所有已经创建的包括终止状态的容器如果数量太多要一个个删除可能会很麻烦用下面的命令可以清理掉所有处于终止状态的容器
```bash
$ docker container prune
```