docker导出日志到本地的方法是什么
359
2022-10-20
Docker----Docker容器的启动流程
(1)首先确认本机没有 hello-world 镜像
[root@redrose2100 ~]# docker images | grep hello-world[root@redrose2100 ~]#
(2)然后执行docker run hello-world 运行hello-world容器,回显如下
[root@redrose2100 ~]# docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world2db29710123e: Pull completeDigest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60fStatus: Downloaded newer image for hello-world:latestHello 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 bashShare images, automate workflows, and more with a free Docker ID: more examples and ideas, visit: ~]#
(3)docker容器的启动流程如下
(1)执行docker run hello-world命令后,docker命令会在本机寻找名为hello-world的镜像,比如这里发现本地没有(2)此时docker 就会去docker hub上搜索名称为hello-world的镜像,比如这里在docker hub上搜索到了hello-world的镜像(3)从docker hub上下载名称为hello-world的镜像到本地(4)使用hello-world镜像执行此docker
(4)第二次执行docker run hello-world运行容器
[root@redrose2100 ~]# docker run hello-worldHello 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 bashShare images, automate workflows, and more with a free Docker ID: more examples and ideas, visit: ~]#
可以发现此时,会使用本地已经存在的镜像。而不会再去docker hub 上下载镜像了
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~