iT邦幫忙

2021 iThome 鐵人賽

DAY 6
1
DevOps

以 Docker 為始的多種開源服務初探系列 第 6

Day 6 不免俗的來個 Hello World Docker

Docker 官方製作了一個有趣的 Hello-world docker 映像檔,現在就來拉取下來跑起來,順便複習一下語法並看看內容吧。

步驟

  1. 執行 docker pull hello-world
  2. 完成後,執行 docker run hello-world
  3. 接著會在命令列中,看到以下的字樣:
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/

這個 hello-world docker 映像檔內,簡單介紹方才你的一系列 docker 指令,其在背後做的事情:

  1. Docker 客戶端連到 docker 執行程式
  2. Docker 執行程式 從 docker-hub 拉取 "hello-world" 映像檔
  3. Docker 由這個 "hello-world" 映像檔產生一個容器,並產出上述文字
  4. Docker 將容器生出的文字輸出到客戶端的命令列上

這由官方所提供的映像檔,其評價相當不錯呢!或許這是個官方所提供的程式工具彩蛋~


上一篇
Day 5 Docker 基礎網路設定
下一篇
Day 7 在 Linode 上購置一台 VPS 主機並安裝 Docker
系列文
以 Docker 為始的多種開源服務初探30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言