千家信息网

Docker 之 运行第一个程序

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,一、运行第一个hello-world程序[root@docker ~]# docker run hello-world#本地无法找到hello-world的镜像Unable to find image
千家信息网最后更新 2025年02月03日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-world1b930d010525: 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 bashShare 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