Easy Tutorial
❮ Docker Architecture Debian Docker Install ❯

Docker rm Command

Docker Command Manual


docker rm: Remove one or more containers.

Syntax

docker rm [OPTIONS] CONTAINER [CONTAINER...]

OPTIONS Description:

-

-f: Forcefully remove a running container via SIGKILL signal.

-

-l: Remove the network connection between containers, not the containers themselves.

-

-v: Remove the volumes associated with the container.

Examples

Forcefully remove containers db01 and db02:

docker rm -f db01 db02

Remove the connection between container nginx01 and container db01 with connection name db:

docker rm -l db

Remove container nginx01 and its associated data volumes:

docker rm -v nginx01

Remove all stopped containers:

docker rm $(docker ps -a -q)

>

For more information, see: Docker Cleanup Command


Docker Command Manual

❮ Docker Architecture Debian Docker Install ❯