"docker container rm" - Remove Container

Q

How to remove a container from the Docker Engine with "docker container rm" command?

✍: FYIcenter.com

A

If a container is no longer needed, you can remove it from the Docker Engine to save space using the "docker container rm" command.

1. Run "docker container list --all" command. You see 2 containers created from the same image, hello-world.

$ docker container list --all

CONTAINER ID  IMAGE        COMMAND   CREATED       STATUS                  NAMES
64e144db8c6c  hello-world  "/hello"  9 hours ago   Exited (0) 2 hours ago  nervous_banach
96ce071457fc  hello-world  "/hello"  15 hours ago  Exited (0) 9 hours ago  gracious_wilson

2. Remove the first container by its name, nervous_banach, to keep the second one.

$ docker container rm nervous_banach
nervous_banach

$ docker ps --all | grep hello

96ce071457fc  hello-world  "/hello"  15 hours ago  Exited (0) 9 hours ago  gracious_wilson

 

"docker container rm ..." - Remove All Containers

"docker container start" - Start Container

Docker Client (or CLI) on Ubuntu

⇑⇑ Docker Container Platform - Tutorials

2019-07-21, 180👍, 0💬