Menu
Coddy logo textTech

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-world

Docker takes the hello-world image, starts a container from it, and the container prints a short welcome message before it exits.

challenge icon

Challenge

Beginner

Run 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-world

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Docker