components/docker/files/man/docker-rm.1
author Jesse Butler <jesse.butler@oracle.com>
Wed, 20 Jul 2016 17:19:20 -0700
changeset 6468 af5d82385cd7
permissions -rw-r--r--
PSARC/2016/354 Docker Engine 1.10.3 23499922 Docker Engine for Solaris 23757816 Docker on Solaris could use a support utility

.TH "DOCKER" "1" " Docker User Manuals" "Docker Community" "JUNE 2014"  ""


.SH NAME
.PP
docker\-rm \- Remove one or more containers


.SH SYNOPSIS
.PP
\fBdocker rm\fP
[\fB\-f\fP|\fB\-\-force\fP]
[\fB\-l\fP|\fB\-\-link\fP]
[\fB\-v\fP|\fB\-\-volumes\fP]
CONTAINER [CONTAINER...]


.SH DESCRIPTION
.PP
\fBdocker rm\fP will remove one or more containers from the host node. The
container name or ID can be used. This does not remove images. You cannot
remove a running container unless you use the \fB\-f\fP option. To see all
containers on a host use the \fBdocker ps \-a\fP command.


.SH OPTIONS
.PP
\fB\-\-help\fP
  Print usage statement

.PP
\fB\-f\fP, \fB\-\-force\fP=\fItrue\fP|\fIfalse\fP
   Force the removal of a running container (uses SIGKILL). The default is \fIfalse\fP.

.PP
\fB\-l\fP, \fB\-\-link\fP=\fItrue\fP|\fIfalse\fP
   Remove the specified link and not the underlying container. The default is \fIfalse\fP.

.PP
\fB\-v\fP, \fB\-\-volumes\fP=\fItrue\fP|\fIfalse\fP
   Remove the volumes associated with the container. The default is \fIfalse\fP.


.SH EXAMPLES
.SH Removing a container using its ID
.PP
To remove a container using its ID, find either from a \fBdocker ps \-a\fP
command, or use the ID returned from the \fBdocker run\fP command, or retrieve
it from a file used to store it using the \fBdocker run \-\-cidfile\fP:

.PP
.RS

.nf
docker rm abebf7571666

.fi
.RE

.SH Removing a container using the container name
.PP
The name of the container can be found using the \fBdocker ps \-a\fP
command. The use that name as follows:

.PP
.RS

.nf
docker rm hopeful\_morse

.fi
.RE

.SH Removing a container and all associated volumes
.PP
$ docker rm \-v redis
  redis

.PP
This command will remove the container and any volumes associated with it.
Note that if a volume was specified with a name, it will not be removed.

.PP
$ docker create \-v awesome:/foo \-v /bar \-\-name hello redis
  hello
  $ docker rm \-v hello

.PP
In this example, the volume for \fB\fC/foo\fR will remain in tact, but the volume for
\fB\fC/bar\fR will be removed. The same behavior holds for volumes inherited with
\fB\fC\-\-volumes\-from\fR.


.SH HISTORY
.PP
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.com source material and internal work.
June 2014, updated by Sven Dowideit 
\[la][email protected]\[ra]
July 2014, updated by Sven Dowideit 
\[la][email protected]\[ra]
August 2014, updated by Sven Dowideit 
\[la][email protected]\[ra]