World map

 

BM: Baca dalam Bahasa Melayu

World D0: Start Here

Containers vs virtual machines

You will learn: how a container (a room) differs from a virtual machine (a whole house).

Checked with Docker Engine 29 on 31 Oct 2026

The problem

Ali tests his app in five virtual computers. His laptop crawls like a tortoise. Each one is a whole computer inside his computer. Is there a lighter way?

Pick one answer.

Watch

Tap each point on the timeline.

A virtual machine (VM): A whole house: a full computer with its own operating system, running inside your computer. (VM) is a whole house. A container is one room in a house. Tap each one to compare.

Watch

The laptop says Ubuntu, the container says Alpine Linux. Then uname shows the same kernel, 6.18.44, on both. Docker transcript: $ cat /etc/os-release PRETTY_NAME="Ubuntu 24.04.5 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.5 LTS (Noble Numbat)" ID=ubuntu $ docker run --rm alpine:3.22 cat /etc/os-release NAME="Alpine Linux" ID=alpine VERSION_ID=3.22.7 PRETTY_NAME="Alpine Linux v3.22" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues" $ uname -a Linux laptop 6.18.44-fc-v185 #1 SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/Linux $ docker run --rm alpine:3.22 uname -a Linux 636a99eaa7f3 6.18.44-fc-v185 #1 SMP PREEMPT_DYNAMIC @0 x86_64 Linux

Your laptop~

  • No open hatches

Lunchboxes (containers)

  • No containers yet

Frozen packs (images)

  • alpine:3.221 layers · 12.9MB
  • nginx:1.30-alpine8 layers · 93.5MB

0 containers (0 running), 2 images, 0 lockers.

The room has its own files: Alpine inside, Ubuntu outside. But both show the same kernel: The heart of the operating system. It runs every program. Containers share the laptop's kernel.. The kernel is the house power. It runs every program, in every room.

Try it

House or room? Sort each fact.

Drag a card into a box. Or tap the card, then tap the box.

      Try it

      Start a room yourself. Type docker run --rm alpine:3.22 echo hi. It says hi, and --rm cleans the room away.

      Your laptop~

      • No open hatches

      Lunchboxes (containers)

      • No containers yet

      Frozen packs (images)

      • alpine:3.221 layers · 12.9MB
      • nginx:1.30-alpine8 layers · 93.5MB

      0 containers (0 running), 2 images, 0 lockers.

      Predict

      Linux containers need a Linux kernel. Your laptop is a Mac. What does Docker Desktop do?

      Pick one answer.

      Check

      Pick the right tool. Is each plan a good idea?

      Swipe right for good, left for needs work. Or use the buttons.

      1 / 4

      Use containers to ship a small web app

      Use containers to ship a small web app

      You did it!

      You can now explain how a container differs from a virtual machine.

      Go deeper (optional)

      A VM has stronger walls, because each house has its own kernel. Rooms are lighter, but they share one kernel. So many clouds run containers inside VMs: rooms inside houses.

      Real rep (optional): once Docker is installed, run docker run --rm alpine:3.22 uname -a and uname -a. Same kernel? On a Mac or Windows, you see the small Linux VM’s kernel.