Images And Containers
Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 2 of 40.
Docker has two core ideas that work together: images and containers.
An image is a read-only template (a snapshot of a filesystem plus instructions for what to run). A container is a running instance created from an image. One image can start many containers, the same way one class can create many objects.
The simplest way to see this is to run a container from the hello-world image:
docker run hello-worldDocker takes the hello-world image, starts a container from it, and the container prints a short welcome message before it exits.
Challenge
BeginnerRun a container from the hello-world image with docker run hello-world. Read the message it prints.
Cheat sheet
Image: a read-only template (filesystem snapshot + run instructions). Container: a running instance created from an image.
Run a container from an image:
docker run hello-worldTry it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.