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 ~]#