World map

 

BM: Baca dalam Bahasa Melayu

World D1: First Containers

Your first docker run

You will learn: what docker run does, one step at a time.

Checked with Docker Engine 29 on 31 Oct 2026

The problem

You want to run an app. No install, no setup, just one line: docker run hello-world. Your laptop has never seen this app. What does Docker do first?

Pick one answer.

Watch

docker run hello-world. Docker can't find the image, so it pulls it from Docker Hub. Then a container runs, prints Hello from Docker!, and stops. The picture shows one image and one grey, finished lunchbox. Docker transcript: $ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 4f55086f7dd0: Pull complete Digest: sha256:c567b231f65614688711a75f31518a064258a51d442117a3e771a3a8fdba78ef Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/

Your laptop~

  • No open hatches

Lunchboxes (containers)

  • No containers yet

Frozen packs (images)

  • No images yet

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

Read the top lines. Docker had no meal pack. So it pull: Fetch an image from a registry, like taking a meal pack out of the shop freezer. one from Docker Hub, the shop freezer. Then a lunchbox ran and said hello.

Try it

docker run does three jobs in a row. Put them in order.

First job at the top. Put these in order. Use the arrows, or drag.

  • Create: fill a lunchbox (the container) from it
  • Start: switch on the app inside the box
  • Pull: fetch the meal pack (the image)

Try it

Your turn. Type docker run hello-world. Watch the picture: a meal pack lands, then a lunchbox appears.

Your laptop~

  • No open hatches

Lunchboxes (containers)

  • No containers yet

Frozen packs (images)

  • No images yet

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

Predict

You type docker run hello-world a second time. What happens?

Pick one answer.

Check

Run it once more. Then type docker ps -a: it lists every container: A sealed lunchbox that holds your app and everything it needs., even finished ones. How many lunchboxes now?

Your laptop~

  • No open hatches

Lunchboxes (containers)

  • vibrant_ritchiestopped
    from hello-world

Frozen packs (images)

  • hello-world:latest1 layers · 25.9kB · in use

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

You did it!

You can now run a container and explain what happened.

Go deeper (optional)

docker run is three commands in one: docker pull, docker create and docker start. Each run makes a new box, with a random name like vibrant_ritchie. Lesson 3 shows how to pick your own.

Real rep (optional). On your own machine, with Docker installed:

Real mission

  1. docker run hello-world
  2. docker ps -a

0 of 3 steps done · Your ticks are saved.