Card 04/ 05

ExampleDifficulty: Beginner1 min

One Image, Three Containers

Start the same image three times and look at what you actually have.

bash
$ docker run -d --name one nginx
$ docker run -d --name two nginx
$ docker run -d --name three nginx

$ docker ps --format '{{.Names}}\t{{.Image}}'
one	nginx
two	nginx
three	nginx

Three containers, one image name. Each has its own writable layer, so a file written inside one does not exist in two, and deleting three leaves the other two running.

The image is the part you share and keep. The container is the part you throw away.