[root@ajn404 /]# sudo systemctl start docker[root@ajn404 /]# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9
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:
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/
补充,判断是否安装成功,可以使用docker version
[root@ajn404 /]# docker version
Client: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:46:54 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:45:28 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
[root@ajn404 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 6 months ago 13.3kB
registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5 latest e121d5f99e1e 3 years ago 448MB
[root@ajn404 ~]# docker tag registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5:latest aliweb:v1[root@ajn404 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 6 months ago 13.3kB
aliweb v1 e121d5f99e1e 3 years ago 448MB
registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5 latest e121d5f99e1e 3 years ago 448MB
[root@ajn404 ~]# docker rmi -f registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5
Untagged: registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5:latest
Untagged: registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5@sha256:243fb0b814e008a2687bb21d6992e1280267b812bcddfb2aabb34c3d72b21c76
[root@ajn404 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 6 months ago 13.3kB
aliweb v1 e121d5f99e1e 3 years ago 448MB
补充
docker search 搜索镜像
[root@ajn404 ~]# docker search --help
Usage: docker search [OPTIONS] TERM
Search the Docker Hub for images
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print search using a Go template
--limit int Max number of search results (default 25)
--no-trunc Don't truncate output
[root@ajn404 ~]# docker search --help
Usage: docker search [OPTIONS] TERM
Search the Docker Hub for images
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print search using a Go template
--limit int Max number of search results (default 25)
--no-trunc Don't truncate output
[root@ajn404 ~]# docker search -f=STARS=200 java
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
node Node.js is a JavaScript-based platform for s… 9012 [OK]
tomcat Apache Tomcat is an opensource implementati… 2775 [OK]
openjdk OpenJDK is an open-source implementation of … 2333 [OK]
java Java is a concurrent, class-based, and objec… 1976 [OK]
ghost Ghost is a free and opensource blogging pla… 1207 [OK]
couchdb CouchDB is a database that uses JSON for doc… 355 [OK]
jetty Jetty provides a Web server and javax.servle… 338 [OK]