Skip to content

Latest commit

 

History

History
64 lines (39 loc) · 1.44 KB

04_delete_container.md

File metadata and controls

64 lines (39 loc) · 1.44 KB

Delete Container

Docker Documentation References:

docker rm

docker ps

Intent

The purpose of this kata is to familarize yourself with the process of removing a container from your local docker installation.

Overview

In this exercise we will delete the most recent container we created in the previous exercises.

Kata Steps

List Contianers

Command

docker ps -a

Output

thought:DockerKata rich$ docker ps -a
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS                      PORTS               NAMES
cfbed98f339d        nginx:alpine                   "nginx -g 'daemon ..."   5 minutes ago       Exited (0) 5 minutes ago                        goofy_jepsen

Select and copy the container name (goofy_jespen)

Because docker generates the name of the container randomly, your container will most likely not be goofy_jepsen. Later we will use names to ensure consistency.

Delete the container

Command

docker rm goofy_jepsen

Output

thought:DockerKata rich$ docker rm goofy_jepsen
goofy_jepsen

List Containers

Command

docker ps -a

Note that goofy_jepsen no longer exists in the listing.

Previous | Index | Next