English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Docker rm Command

Docker Command大全

docker rm :Delete one or more containers.

Syntax

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

OPTIONS Description:

  • -f :Force delete a running container with the SIGKILL signal.

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

  • -v :Delete volumes associated with the container.

Online Examples

Force delete container db01、db02:

docker rm -f db01 db02

Remove container nginx01 to container db01 connection, connection name db:

docker rm -l db

Delete container nginx01, and delete the mounted data volume:

docker rm -v nginx01

Delete all stopped containers:

docker rm $(docker ps -a -q)

Docker Command大全