4-Docker命令之docker rm

1.docker rm介绍

docker rm命令是用来删除一个或多个已经停止的docker容器

2.docker rm用法

docker rm [参数] container [container......]

[root@centos79 ~]# docker rm --help

Usage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers

Aliases:
  docker container rm, docker container remove, docker rm

Options:
  -f, --force     Force the removal of a running container (uses SIGKILL)
  -l, --link      Remove the specified link
  -v, --volumes   Remove anonymous volumes associated with the container
[root@centos79 ~]# 

3.实例

3.1.删除已经停止的docker容器

命令:

docker rm 6c62c

[root@centos79 ~]# docker ps -a | grep centos-nginx
6c62c2ba32ec   centos-nginx:1.0                    "/bin/bash"               18 hours ago   Exited (137) 17 hours ago                                                                                          ztj
[root@centos79 ~]# docker rm 6c62c
6

你可能感兴趣的:(docker,容器)