Repaso
EspaƱol
Cloud & DevOpsCoreOPS-30

Docker image vs container?

Options

  1. They are the same thing, a different word for one concept
  2. An image is a read-only template; a container is a running instance (Correct option)
  3. A container is a file you download; an image is what runs
  4. Images run only on Linux servers, while containers run anywhere

Answer

An image is a read-only template (app + dependencies); a container is a running instance created from an image

Why

Think of a class and its objects: the image is the blueprint, the container is the running thing.

You build an image once (docker build), push it to a registry, and start as many containers from it as you need (docker run).

Each container gets its own isolated filesystem changes, which disappear when it is removed.

Remember

Image = template. Container = running instance.

Key terms

Practice this question in Repaso