一、運行第一個hello-world程序
[root@docker ~]# docker run hello-world
#本地無法找到hello-world的鏡像
Unable to find image 'hello-world:latest' locally
#從遠程倉庫拉取hello-world鏡像
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:4df8ca8a7e309c256d60d7971ea14c27672fc0d10c5f303856d7bc48f8cc17ff
#下載完成了一個新的鏡像(hello-world)
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:
#docker的客戶端連接到服務器的docker服務端,以守護進程在後臺啓動,典型的CS
1. The Docker client contacted the Docker daemon.
#docer服務端從docker hub遠程倉庫下載了一個hello-world的鏡像
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
#docker服務端通過這個鏡像啓動了一個新的容器,執行了相應的命令或程序,輸出了一段信息或內容。
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
#docker服務器把數據流輸出到docker客戶端,併發送到你的終端。
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/