Docker 之 运行第一个程序
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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/
以上是关于Docker 之 运行第一个程序的主要内容,如果未能解决你的问题,请参考以下文章
Docker删除报错:Error response from daemon: conflict: unable to delete 08b152afcfae (must be forced)(代码片段