Skip to content
BENIBIX Learn

Container Image

Infrastructure📦 ContainersImages and Registries

Also known as Docker Image, OCI Image, Image (Containers)

The saved pack that a container starts from. One image can start many of them.

Think of it like

It is like a cookie cutter. One cutter makes as many cookies as you want, all the same.

Example

Emma builds an image of her shop app and tags it 1.4. The test server and the live server both start containers from that same image.

Why it matters

The image never changes, so what you tested is exactly what goes live.

Definition

A container image is the saved package a container starts from. It holds the app, its tools and its settings, stacked in layers. Each layer adds or changes some files. An image never changes once it is built. To change it, you build a new one with a new tag. One image can start many containers at the same time.

Example code

bash
docker build -t shop-app:1.4 .
docker run -d shop-app:1.4
The first line builds the image and names it. The second starts a container from it.
The image sits in the middle. It is built once, stored, and then started as many containers.

Common mistake

Treating an image and a container as the same thing. The image is the plan, and a container is one copy running from it.

Key takeaways

  1. 1
    Built in layers. Each layer adds or changes some files.
  2. 2
    Never changes. A change means a new image.
  3. 3
    Tagged by version. The tag says which build it is.

Compare