INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: Container foundations

Containers for beginners: images, runtime, hosts and persistent data

A container runs application processes in a separated environment. An image packages the files used for that execution; it is not itself a running application. Use two API containers made from one image to understand Linux hosts, networking and data lifetimes.

What you will learn

Distinguish images from containers, host responsibilities and data lifetimes, then identify conditions to check before execution.

Prerequisite

A process is a running program; the host provides its execution environment. This is a fixed reading exercise with no installation or container execution. Windows-specific isolation modes are outside this Linux-focused example.

One image can create separate executions

Report API example: arrows show creation and execution relationships
Report API example: arrows show creation and execution relationships1: Image A — Create from the image — Container A. 2: Image A — Reuse the same image — Container B. 3: Container A — Runs on the host — Linux host. 4: Container B — Runs on the same host in this example — Linux host1234Image AContainer AContainer BLinux hostReport API example: arrows show creation and execution relationships1: Image A — Create from the image — Container A. 2: Image A — Reuse the same image — Container B. 3: Container A — Runs on the host — Linux host. 4: Container B — Runs on the same host in this example — Linux host1234Image AContainer AContainer BLinux host
  1. Image A → Container ACreate from the image
  2. Image A → Container BReuse the same image
  3. Container A → Linux hostRuns on the host
  4. Container B → Linux hostRuns on the same host in this example
Image A
Application files and libraries
Container A
API execution; its own writable layer
Container B
Separate execution from the same image
Linux host
Provides the kernel and runtime environment
Separate stored artifacts from execution state
ObjectContents or roleWhat it does not establish
ImageApplication files, libraries and defaults; changed content produces another image.Whether it is running or external data and secrets are correctly supplied.
ContainerAn execution environment with processes and a writable layer.Whether it has the same state as another container or durable data.
Host and runtimeExecute processes and provide resources and separation.Whether all applications have enough capacity or are secure.

Virtual machines and containers separate different layers

The kernel is the OS core managing processes, memory and devices. Ordinary Linux containers share the host kernel. Linux distribution files inside an image do not mean every container starts its own independent Linux kernel.

How to compare separation for the same application
AspectVirtual machineOrdinary Linux container
OS coreGuest OS has its own kernel.Shares the host kernel.
SeparationRuns an OS on a virtualized machine.Separates process-visible resources and related state.
CombinationA VM can host containers.Containers do not necessarily replace VMs.

Linux namespaces separate views of resources; cgroups account for and limit resource use. Configuration, privileges, shared mounts and kernel vulnerabilities still matter. Containerization is not permission to run arbitrary untrusted software safely.

Separate stopping, recreating and deleting data

A container’s writable layer records its changes. In Docker it normally remains when the container is merely stopped, but deleting and recreating the container does not retain that layer. Check automatic removal settings and the actual storage destination.

Fixed example: locate the report data
LocationWhat to check when recreating
Temporary file only in container ARemoving A’s writable layer can lose it.
An explicitly retained named volumeHas a separate lifetime; check volume deletion and retention conditions.
External database or object storageReview data permissions, retention and consistency separately from container replacement.

When containers use the same volume or external database, changes to shared data can affect other users. Separate containers do not automatically mean independent data, and a volume alone does not establish recoverability.

Check execution conditions even with the same image

The same files do not guarantee the same outcome
ConditionHow to reason about it
OS and CPU architectureDo not assume Linux/amd64-only content runs unchanged on ARM64.
Configuration and secretsSupply environment-specific settings and secrets separately; do not embed them in images.
Networking and authorizationCheck the path to an API and permission to access its data.
CPU, memory and storageDo not assume desktop capacity or data lifetimes match another environment.

In AWS, ECR stores and distributes images, ECS manages task and service execution, and Fargate is one compute option. These map shared concepts to AWS; containers do not require AWS.

  1. Identify the image’s purpose, source, version and OS/CPU requirements.
  2. Review external connections, permissions and secret delivery.
  3. Separate temporary, durable and shared data.
  4. Define resource limits, stopping/replacement and health checks.

Practise distinguishing artifacts and execution

Choose an option to see the result and explanation.

A and B are created from one image. What follows?
Read the answer and reason

Answer: They share an artifact but need separate execution-state checks · Distinguish image content from each running execution’s state.

What do ordinary Linux containers share on one host?
Read the answer and reason

Answer: The host’s Linux kernel · Distinguish OS files in an image from the kernel supporting execution.

A writes reports to a named volume. What should you inspect when replacing A?
Read the answer and reason

Answer: Check reuse of the volume and whether the volume itself is deleted · Check container and data lifetimes separately, including shared use.

A Linux/amd64 image moves to another environment. What still needs checking?
Read the answer and reason

Answer: OS/CPU compatibility, configuration, connectivity, permissions and resources · Reusable files and conditions for successful execution are separate.

Check, then explain in your own words

  1. Identify the image, two containers and host in the diagram.
  2. Explain temporary-file, volume and external-database lifetimes.
  3. Check platform, permissions and configuration, then study image identity.
Check your understanding: Besides the image, what should you inspect before recreating a container?

Runtime conditions, permissions and connectivity, resources, and data location/lifetime.

The same image does not guarantee the same running state, external data or reachability. Inspect artifacts and execution responsibilities separately.

Sources and conditions checked

Primary references are collected here with their scope, conditions and corresponding sections. Independent expert review and live-environment validation have not been performed.