Card 04/ 05
All 5 cards
ExampleDifficulty: Beginner1 min
One Image, Three Containers
Start the same image three times and look at what you actually have.
$ 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 nginxThree 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.