Step-By-Step Process To Remove Docker Container
Step 1: Provide a list of every container on the Docker host.
docker ps -a
Step 2: Stop the docker container before deleting it.
docker stop <Container name> or <Contaier ID>
Step 3: Remove the Docker container when it has stopped; you cannot remove the Docker container unless it has stopped.
docker rm <Container name> or <Contaier ID>
What Is Docker rm Command ?
“docker rm” is used to remove one or more Docker containers that are running on the Docker host. A Docker container uses up system resources like CPU, memory, and disk space when it is running. To free up such resources, you may choose to uninstall a container after using it for a while.
docker rm [OPTIONS] CONTAINER [CONTAINER…]
- OPTIONS: Various options can be used with the docker rm command to modify its behavior.
- CONTAINER: The name or ID of the Docker container(s) to be removed.