Drop or destroy the stopped container in Docker

Drop the stopped container in Docker

Destroy a stopped container permanently, all data and information are lost.

Check the stopped container in Docker:

sh-4.2$ sunny@Oracle1:/etc$ docker ps -a
CONTAINER ID   IMAGE          COMMAND     CREATED          STATUS                        PORTS     NAMES
bda5c34bfbd2   image-oracle   "/bin/sh"   18 minutes ago   Exited (137) 15 minutes ago             zealous_ellis
eeb55035fffe   orcl2-image    "/bin/sh"   3 hours ago      Exited (0) 23 minutes ago               fervent_herschel

Destroy the stopped container in Docker:

#docker rm <container_name/id>

sunny@Oracle1:/etc$ docker rm bda5c34bfbd2
bda5c34bfbd2

Verify the stopped container again:


sunny@Oracle1:/etc$ docker ps -a

CONTAINER ID   IMAGE         COMMAND     CREATED       STATUS                      PORTS     NAMES

eeb55035fffe   orcl2-image   "/bin/sh"   3 hours ago   Exited (0) 24 minutes ago             fervent_herschel
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.