TOPIC 18/3712 MINNOT STARTED

Containers as disposable test environments

A container packs a program with everything it needs, so the same setup starts the same way on any computer. That makes a clean, throwaway test environment cheap to build.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a sealed lunch box. A sealed lunch box holds the same meal wherever you open it. The food does not mix with anyone else's. When lunch is over, you throw the box away. Tomorrow you get a new one, packed the same way.

Daily List is a to-do list app. Leo packs the app and its small database into boxes of this kind. Tom starts them on his own computer, and the pipeline starts them on a machine far away. The shared images reduce setup differences, but host kernel/architecture, configuration, mounted data and external services can still affect behaviour.

These boxes are containers. The pack list that makes them is a . A team that uses containers can say "works on my machine" less often, because everyone's machine runs the same box.

The picture has a limit. A lunch box holds food and nothing else. A container shares the engine of the computer it runs on, and it can still hold faults.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Packing the same setup so it starts the same anywhere and can be thrown away.

  1. Pack the image
  2. Open the container
  3. Run the tests
  4. Bin it
Pack, open, bin

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The sealed lunch boxA container
The pack listA container image
The same meal everywhereThe same setup on every machine
Throwing the box awayRemoving the container

WHERE THIS PICTURE STOPS

  • A lunch box holds food only. A container shares the engine of its computer.
  • A meal cannot be faulty in code. A container can hold a fault.
  • A box is thrown away whole. A volume can outlive a container.

HOOK

Same box, any place, then bin it.

REMEMBER IT THIS WAY

A contrast: two neighbours told apart by one test.

The image is the pack list. The container is the box made from it, started anywhere and thrown away when lunch is over.

What each part of the trick stands for
In the trickWhat it stands for
Imagethe pack list that makes them
Containerboxes that hold the app and its small database

TELL A FRIEND

A sealed lunch box: the same meal anywhere, thrown away after.

OFTEN MIXED UP WITH Test data and environments in pipelines. The lesson explains why a fresh place and known data matter. This lesson shows one cheap way to build that place.

Sources & standards — 1 source
  1. Market practice

    Storage in Docker Engine ↗ — Docker · Current storage overview, opened 6 November 2026: image/container writable state and mounted persistent data differ.

    Current storage overview: container writable layer versus persistent volume and bind mount. Container removal and database-data reset are distinct. · Checked 2026-11-06

    Publisher primary source opened and relevant sections read on 6 November 2026 for the Agile/DevOps domain analysis. Original explanations are used; no extensive source text is copied. Also read for the CI/Containers analysis; live documentation does not establish the version installed in a learner environment.

PRACTISE AND KEEP

Sources for this topic — 8 sources
  1. Market practice

    Understanding Docker components (Tailscale Docs) ↗ — Tailscale · An image is a packaged template; a container is a running instance of an image, isolated in its own files, network and processes (search excerpt, page not opened)

    Says an image is a packaged template and a container is a running instance of it, isolated in its own file system, network and processes. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    OCI Image Format Specification (Open Container Initiative) ↗ — Open Container Initiative · An OCI image consists of a manifest, an optional image index, a set of layers of files and a configuration (search excerpt, page not opened)

    Defines an image as a manifest, optional index, filesystem layers and a configuration. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: v1.0.1. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    Docker Compose overview (Docker Docs) ↗ — Docker · Docker Compose defines and runs multi-container applications from one YAML file (search excerpt, page not opened)

    Says Compose defines and runs multi-container applications from one YAML Ain't Markup Language (YAML) file. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    docker compose down (Docker Docs) ↗ — Docker · docker compose down removes the containers and networks; volumes are removed only with the --volumes flag (search excerpt, page not opened)

    Says down removes the containers and networks, and removes volumes only with the --volumes flag. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-11-06

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    Verification supplement, 6 November 2026: Actual current command reference opened: default removes containers/networks, volumes remain; --volumes explicit; external volumes not removed.

  5. Market practice

    docker container logs (Docker Docs, CLI reference) ↗ — Docker · docker logs fetches the logs of a container; options include follow, tail, since and timestamps (search excerpt, page not opened)

    Says docker logs fetches the output a container wrote, with options such as follow, tail, since and timestamps. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  6. Market practice

    Dev/prod parity (The Twelve-Factor App) ↗ — Adam Wiggins · Dev/prod parity: keep the tools gap between development and production small (search excerpt, page not opened)

    Says to keep the time, personnel and tools gaps between development and production small. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  7. Market practice

    docker-selenium README ↗ — SeleniumHQ (GitHub) · r8a-docker-selenium-readme (standalone-chrome and other images; shm-size 2g advice). The page does not say in the excerpt that the driver is bundled, so the insert does not claim it. Search excerpt, page not opened.

    Ready-made Selenium images for Chrome, Firefox and Edge; browser images need extra shared memory such as shm-size 2g. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  8. Market practice

    Storage in Docker Engine ↗ — Docker · Current storage overview, opened 6 November 2026: image/container writable state and mounted persistent data differ.

    Current storage overview: container writable layer versus persistent volume and bind mount. Container removal and database-data reset are distinct. · Checked 2026-11-06

    Publisher primary source opened and relevant sections read on 6 November 2026 for the Agile/DevOps domain analysis. Original explanations are used; no extensive source text is copied. Also read for the CI/Containers analysis; live documentation does not establish the version installed in a learner environment.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.