World map

 

BM: Baca dalam Bahasa Melayu

World D0: Start Here

YAML part 1: keys and lists

You will learn: how to write YAML keys, values and lists that a computer reads exactly as you mean.

Checked with Docker Engine 29 on 31 Oct 2026

The problem

Compose files, CI pipelines and Kubernetes all use YAML. A computer reads your note word by word. Which note can it read?

Pick one answer.

Watch

YAML: A neat recipe card for computers, made of keys, colons, dashes and spaces. is a neat recipe card for computers. Each line is a key, a colon, a space, then the value. The box shows how a computer reads it.

Change the dish to laksa. Watch the box below.

order.yaml4 lines

How a computer reads it

  • dishnasi lemaktext
  • price5number
  • spicytruetrue/false

Watch

A list is lines that start with a dash and a space. Key or list item? Sort each line.

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

      Try it

      The list sits under its key, two spaces in. Add one more side dish.

      Add cucumber as a third side.

      order.yaml5 lines

      How a computer reads it

      • dishnasi lemaktext
      • sideslist ยท 2 items
        • item 1sambaltext
        • item 2eggtext

      Predict

      price: 5 and price: "5". Does a computer read them the same?

      Pick one answer.

      Check

      Will a computer read each line the way you mean? Swipe right if yes.

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

      1 / 5dish: laksa
      dish: laksa

      You did it!

      You can now write YAML keys, values and lists.

      Go deeper (optional)

      A line that starts with # is a comment: computers skip it. A short list can sit on one line: sides: [sambal, egg]. YAML files end in .yaml or .yml.

      Real rep (optional): open any compose.yaml or workflow file on GitHub. Find one key and one list.