Thuta Learning
BasicDevOps & Toolsintermediate

Images vs Containers

Relax. We'll talk through this in plain words — no textbook voice.

The two most important concepts in Docker are Image and Container.

Image is a read-only template containing the file system, dependencies, and instructions needed to run an app. Think of it like a blueprint.

Container is a running instance based on an image — like a house actually built from that blueprint. You can run many containers from a single image.

dockerfile
# Pull the image first
docker pull nginx

# Create and run a container from that image
docker run --name my-nginx -d -p 8080:80 nginx

# Show running containers
docker ps

The first command downloads the nginx image onto your local machine. The second command uses that image to run a container named my-nginx.

You should see
You should see the my-nginx container listed as running in docker ps.

Info

An image is an unchanging template, while a container is a running process. Even if you delete the container, the image stays put.

Easy traps

  • Calling an image a "container" or a container an "image" is one of the most common mix-ups for beginners. Knowing the difference between the two makes debugging a lot easier.
Images vs Containers | Thuta Learning