1DOCKER(1)                          JUNE 2014                         DOCKER(1)
2
3
4

NAME

6       docker-rm - Remove one or more containers
7
8
9

SYNOPSIS

11       docker rm [-f|--force] [-l|--link] [-v|--volumes] CONTAINER
12       [CONTAINER...]
13
14
15

DESCRIPTION

17       docker rm will remove one or more containers from the host node. The
18       container name or ID can be used. This does not remove images. You
19       cannot remove a running container unless you use the -f option. To see
20       all containers on a host use the docker ps -a command.
21
22
23

OPTIONS

25       --help
26         Print usage statement
27
28
29       -f, --force=true|false
30          Force the removal of a running container (uses SIGKILL). The default
31       is false.
32
33
34       -l, --link=true|false
35          Remove the specified link and not the underlying container. The
36       default is false.
37
38
39       -v, --volumes=true|false
40          Remove the volumes associated with the container. The default is
41       false.
42
43
44

EXAMPLES

Removing a container using its ID

47       To remove a container using its ID, find either from a docker ps -a
48       command, or use the ID returned from the docker run command, or
49       retrieve it from a file used to store it using the docker run
50       --cidfile:
51
52
53              docker rm abebf7571666
54
55
56

Removing a container using the container name

58       The name of the container can be found using the docker ps -a command.
59       The use that name as follows:
60
61
62              docker rm hopeful_morse
63
64
65

Removing a container and all associated volumes

67              $ docker rm -v redis
68              redis
69
70
71
72       This command will remove the container and any volumes associated with
73       it.  Note that if a volume was specified with a name, it will not be
74       removed.
75
76
77              $ docker create -v awesome:/foo -v /bar --name hello redis
78              hello
79              $ docker rm -v hello
80
81
82
83       In this example, the volume for /foo will remain in tact, but the
84       volume for /bar will be removed. The same behavior holds for volumes
85       inherited with --volumes-from.
86
87
88

HISTORY

90       April 2014, Originally compiled by William Henry (whenry at redhat dot
91       com) based on docker.com source material and internal work.  June 2014,
92       updated by Sven Dowideit ⟨SvenDowideit@home.org.au⟩ July 2014, updated
93       by Sven Dowideit ⟨SvenDowideit@home.org.au⟩ August 2014, updated by
94       Sven Dowideit ⟨SvenDowideit@home.org.au⟩
95
96
97
98Docker Community              Docker User Manuals                    DOCKER(1)
Impressum