3-运行第一个docker image-hello world
  wwLZeziuqjLR 2023年12月09日 12 0

CentOS7.9下安装完成docker后,我们开始部署第一个docker image-hello world

1.以root用户登录CentOS7.9服务器,拉取centos7 images

命令:

docker pull hello-world

[root@centos79 ~]# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
[root@centos79 ~]#

2.查看docker镜像

命令:

docker images | grep hello-world

[root@centos79 ~]# docker images | grep hello-world
hello-world                  latest     feb5d9fea6a5   2 years ago     13.3kB
[root@centos79 ~]#

3.运行docker镜像hello-world

命令:

docker run hello-world

[root@centos79 ~]# docker run hello-world

Hello 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 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/

[root@centos79 ~]#



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年12月09日 0

暂无评论

推荐阅读
  wwLZeziuqjLR   2023年12月11日   14   0   0 Dockercentos
  MCWYWqSAMsot   2023年12月11日   16   0   0 Docker
  DnoStTHsc0vp   2023年12月11日   12   0   0 Docker
  wwLZeziuqjLR   2023年12月08日   66   0   0 Dockercentosbash