Peta dunia

 

EN: Read in English

Dunia D1: Container Pertama

docker run pertama anda

Anda akan belajar: apa yang docker run buat, satu langkah demi satu langkah.

Teks BM belum disemak oleh penutur asli.

Disemak dengan Docker Engine 29 pada 31 Okt 2026

Masalahnya

Anda mahu jalankan satu aplikasi. Tak perlu pasang, tak perlu tetapan. Cuma satu baris: docker run hello-world. Laptop anda tak pernah ada aplikasi ini. Apa Docker buat dulu?

Pilih satu jawapan.

Tengok

docker run hello-world. Docker tak jumpa image, jadi ia tarik dari Docker Hub. Kemudian satu container berjalan, paparkan Hello from Docker!, lalu berhenti. Gambar tunjuk satu image dan satu bekas kelabu yang sudah selesai. Transkrip Docker: $ 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/

Laptop anda~

  • Tiada tingkap terbuka

Bekas (container)

  • Belum ada container

Pek beku (image)

  • Belum ada image

0 container (0 berjalan), 0 image, 0 loker.

Baca baris atas. Docker tiada pek beku. Jadi ia pull (tarik) (pull): Ambil image dari registry, macam ambil pek beku dari peti sejuk kedai. satu dari Docker Hub, peti sejuk kedai. Kemudian satu bekas berjalan dan beri salam.

Cuba

docker run buat tiga kerja berturut-turut. Susun ikut urutan.

Kerja pertama di atas. Susun ikut turutan. Guna anak panah, atau seret.

  • Start: hidupkan aplikasi dalam bekas
  • Create: isi bekas makanan (container) daripadanya
  • Pull: ambil pek beku (image)

Cuba

Giliran anda. Taip docker run hello-world. Tengok gambar: pek beku sampai, kemudian bekas muncul.

Laptop anda~

  • Tiada tingkap terbuka

Bekas (container)

  • Belum ada container

Pek beku (image)

  • Belum ada image

0 container (0 berjalan), 0 image, 0 loker.

Teka

Anda taip docker run hello-world sekali lagi. Apa jadi?

Pilih satu jawapan.

Semak

Jalankan sekali lagi. Kemudian taip docker ps -a: ia senaraikan setiap container: Bekas bertutup yang bawa aplikasi dan semua keperluannya., termasuk yang sudah selesai. Berapa bekas sekarang?

Laptop anda~

  • Tiada tingkap terbuka

Bekas (container)

  • vibrant_ritchieberhenti
    dari hello-world

Pek beku (image)

  • hello-world:latest1 layer · 25.9kB · sedang diguna

1 container (0 berjalan), 1 image, 0 loker.

Anda berjaya!

Kini anda boleh jalankan container dan terangkan apa yang berlaku.

Nak tahu lebih (pilihan)

docker run ialah tiga arahan dalam satu: docker pull, docker create dan docker start. Setiap run buat bekas baru, dengan nama rawak seperti vibrant_ritchie. Pelajaran 3 tunjuk cara pilih nama sendiri.

Latihan sebenar (pilihan). Di mesin anda sendiri, dengan Docker sudah dipasang:

Misi sebenar

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

0 daripada 3 langkah siap · Tanda anda disimpan.