欢迎光临
我们一直在努力

Docker 之 运行第一个程序

一、运行第一个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/
赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。