github.com/tompao/docker@v1.9.1/docs/reference/commandline/rm.md (about) 1 <!--[metadata]> 2 +++ 3 title = "rm" 4 description = "The rm command description and usage" 5 keywords = ["remove, Docker, container"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 # rm 12 13 Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...] 14 15 Remove one or more containers 16 17 -f, --force=false Force the removal of a running container (uses SIGKILL) 18 --help=false Print usage 19 -l, --link=false Remove the specified link 20 -v, --volumes=false Remove the volumes associated with the container 21 22 ## Examples 23 24 $ docker rm /redis 25 /redis 26 27 This will remove the container referenced under the link 28 `/redis`. 29 30 $ docker rm --link /webapp/redis 31 /webapp/redis 32 33 This will remove the underlying link between `/webapp` and the `/redis` 34 containers removing all network communication. 35 36 $ docker rm --force redis 37 redis 38 39 The main process inside the container referenced under the link `/redis` will receive 40 `SIGKILL`, then the container will be removed. 41 42 $ docker rm $(docker ps -a -q) 43 44 This command will delete all stopped containers. The command 45 `docker ps -a -q` will return all existing container IDs and pass them to 46 the `rm` command which will delete them. Any running containers will not be 47 deleted.