docker rm : Delete one or more containers. OPTIONS description: -f : Force the deletion of a running container through a SIGKILL signal. -l : Remove the network connection between containers, not the container itself. -v : Delete the volume associated with the container. Force deletion of container db01 and db02: Remove the connection of container nginx01 to container db01, connection name db: Delete the container nginx01 and delete the data volume mounted by the container: Delete all containers that have been stopped: For more information, see: Docker 清理命令 2.33.1. Grammar ¶
docker rm [OPTIONS] CONTAINER [CONTAINER...]
2.33.2. Example ¶
docker rm -f db01 db02
docker rm -l db
docker rm -v nginx01
docker rm $(docker ps -a -q)