World map

 

BM: Baca dalam Bahasa Melayu

World D1: First Containers · Boss challenge

Night shift

You will learn: to find and fix three broken containers on your own.

Checked with Docker Engine 29 on 31 Oct 2026

The problem

docker ps -a lists three boxes. db: Exited (1). timer: Exited (127). web: Up, with the hatch 0.0.0.0:8080->8080/tcp. Docker transcript: $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b27bdf2275f5 postgres:18-alpine "docker-entrypoint.s…" 6 seconds ago Exited (1) 6 seconds ago db 034b6a2a054e alpine:3.22 "sh -c 'echo Timer o…" 9 seconds ago Exited (127) 9 seconds ago timer 8d5f42c9113a nginx:1.30-alpine "/docker-entrypoint.…" 12 seconds ago Up 12 seconds 80/tcp, 0.0.0.0:8080->8080/tcp web

Your laptop~

  • Laptop port 8080 → web port 8080

Lunchboxes (containers)

  • webrunning
    from nginx:1.30-alpine 8080→8080
  • timerfailed (exit 127)
    from alpine:3.22
  • dbfailed (exit 1)
    from postgres:18-alpine no name → /var/lib/postgresql

Frozen packs (images)

  • alpine:3.221 layers · 12.9MB · in use
  • nginx:1.30-alpine8 layers · 93.5MB · in use
  • postgres:18-alpine9 layers · 433MB · in use

Lockers (volumes)

  • 1067bd10d611… (no name)0 files · used by db

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

Boss: night shift! The day cook left three broken lunchboxes. The shop opens at 7. Fix web, timer and db.

Try it

Box 1: web is Up, but curl localhost:8080 fails. Check its hatch, then fix it.

Your laptop~

  • Laptop port 8080 → web port 8080

Lunchboxes (containers)

  • webrunning
    from nginx:1.30-alpine 8080→8080
  • timerfailed (exit 127)
    from alpine:3.22
  • dbfailed (exit 1)
    from postgres:18-alpine no name → /var/lib/postgresql

Frozen packs (images)

  • alpine:3.221 layers · 12.9MB · in use
  • nginx:1.30-alpine8 layers · 93.5MB · in use
  • postgres:18-alpine9 layers · 433MB · in use

Lockers (volumes)

  • 1067bd10d611… (no name)0 files · used by db

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

Check

curl said Connection reset by peer. Why did -p 8080:8080 fail?

Pick one answer.

Try it

Box 2: timer stops at once with Exited (127). Find out why, then make it tick for an hour.

Your laptop~

  • Laptop port 8080 → web port 80

Lunchboxes (containers)

  • webrunning
    from nginx:1.30-alpine 8080→80
  • timerfailed (exit 127)
    from alpine:3.22
  • dbfailed (exit 1)
    from postgres:18-alpine no name → /var/lib/postgresql

Frozen packs (images)

  • alpine:3.221 layers · 12.9MB · in use
  • nginx:1.30-alpine8 layers · 93.5MB · in use
  • postgres:18-alpine9 layers · 433MB · in use

Lockers (volumes)

  • 596e2561bb82… (no name)0 files · used by db

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

Check

Notes for the next night shift. Where do you look first?

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

      Try it

      Box 3: db stops with Exited (1). Read what it asks for. Then give it that.

      Your laptop~

      • Laptop port 8080 → web port 80

      Lunchboxes (containers)

      • webrunning
        from nginx:1.30-alpine 8080→80
      • timerrunning
        from alpine:3.22
      • dbfailed (exit 1)
        from postgres:18-alpine no name → /var/lib/postgresql

      Frozen packs (images)

      • alpine:3.221 layers · 12.9MB · in use
      • nginx:1.30-alpine8 layers · 93.5MB · in use
      • postgres:18-alpine9 layers · 433MB · in use

      Lockers (volumes)

      • 24cd65684366… (no name)0 files · used by db

      3 containers (2 running), 3 images, 1 lockers.

      Check

      7 a.m. check. docker ps lists db, timer and web, all Up. curl -sI localhost:8080 answers HTTP/1.1 200 OK. Docker transcript: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d4dbfc3db18b postgres:18-alpine "docker-entrypoint.s…" 3 seconds ago Up 3 seconds 5432/tcp db e7f0b578db98 alpine:3.22 "sleep 3600" 6 seconds ago Up 6 seconds timer 886924472cfa nginx:1.30-alpine "/docker-entrypoint.…" 9 seconds ago Up 9 seconds 0.0.0.0:8080->80/tcp web $ curl -sI localhost:8080 HTTP/1.1 200 OK Server: nginx/1.30.6 Date: Sat, 31 Oct 2026 01:00:15 GMT Content-Type: text/html Content-Length: 896 Last-Modified: Fri, 02 Oct 2026 17:14:31 GMT Connection: keep-alive ETag: "6abfe677-380" Accept-Ranges: bytes

      Your laptop~

      • Laptop port 8080 → web port 80

      Lunchboxes (containers)

      • webrunning
        from nginx:1.30-alpine 8080→80
      • timerrunning
        from alpine:3.22
      • dbrunning
        from postgres:18-alpine no name → /var/lib/postgresql

      Frozen packs (images)

      • alpine:3.221 layers · 12.9MB · in use
      • nginx:1.30-alpine8 layers · 93.5MB · in use
      • postgres:18-alpine9 layers · 433MB · in use

      Lockers (volumes)

      • 5308b82d4150… (no name)24 files · used by db

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

      7 a.m. check: three boxes Up. The hatch answers 200 OK. The shop can open. Night shift done!

      You did it!

      You can now find and fix broken containers on your own.

      Go deeper (optional)

      Your night shift checklist. 1: docker ps -a shows the state. 2: docker logs tells you why it stopped. 3: docker port or docker inspect checks the setup. 4: remove the box, then run it again, right.

      Real rep (optional): break a box on purpose, then fix it.

      Real mission

      1. docker run -d --name db postgres:18-alpine
      2. docker ps -a
      3. docker logs db
      4. docker rm db
      5. docker run -d --name db -e POSTGRES_PASSWORD=secret postgres:18-alpine
      6. docker rm -f db

      0 of 6 steps done · Your ticks are saved.