docker_practice/container/rm.md
Kang HuaiShuai 5cb92f63cf
Update title style
Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
2019-11-06 14:58:03 +08:00

19 lines
594 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
```