Images, tags & containers
An image is a recipe, a container is an instance
Lesson 1 of 20 · 9 min · Module 1: Containers and access
Separate the packaged application from a running instance of it.
Start this lesson →Free. No installation: you write and run the code in your browser, and it is checked automatically.
By the end, you’ll be able to…
- Distinguish an image from an instance
- Name the thing you will operate
The idea
Container operations change instances and their attached configuration. Inspect the resulting state as well as the command sequence.
docker pull nginx:1.27-alpine
docker run -d --name demo nginx:1.27-alpine
docker ps
01Distinguish an image from an instance
An image describes a filesystem and startup configuration. Running it creates a container with its own writable layer; several containers can use the same image.
02Name the thing you will operate
--name gives a stable identifier for stop, logs, and inspect. -d asks Docker to run in the background, rather than occupying the terminal.
03Observe after changing state
docker ps lists running containers; docker ps -a includes stopped instances. This practice model reports its in-memory state and never starts a real process.
Your turn
What the checks look for
- web runs the requested image
- Lists running containers
Take this with you
Treat the image as packaged input and the container as an instance with a lifecycle.
Go a little further
Start a second container from the same image and compare their names.